Search in sources :

Example 21 with JetConfig

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[]
}
Also used : SerializerConfig(com.hazelcast.config.SerializerConfig) JetInstance(com.hazelcast.jet.JetInstance) JetConfig(com.hazelcast.jet.config.JetConfig)

Example 22 with JetConfig

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[]
}
Also used : JetInstance(com.hazelcast.jet.JetInstance) JetConfig(com.hazelcast.jet.config.JetConfig)

Example 23 with JetConfig

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));
    }
}
Also used : JetConfig(com.hazelcast.jet.config.JetConfig) JetServiceBackend(com.hazelcast.jet.impl.JetServiceBackend)

Example 24 with JetConfig

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);
}
Also used : MapConfig(com.hazelcast.config.MapConfig) JetConfig(com.hazelcast.jet.config.JetConfig) DiscardMergePolicy(com.hazelcast.spi.merge.DiscardMergePolicy)

Example 25 with JetConfig

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();
}
Also used : Config(com.hazelcast.config.Config) JetConfig(com.hazelcast.jet.config.JetConfig) ClientFailoverConfig(com.hazelcast.client.config.ClientFailoverConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) Nonnull(javax.annotation.Nonnull)

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