Search in sources :

Example 6 with Context

use of com.hazelcast.jet.core.Processor.Context in project hazelcast-jet by hazelcast.

the class SlidingWindowP_failoverTest method init.

private void init(ProcessingGuarantee guarantee) {
    SlidingWindowPolicy wDef = SlidingWindowPolicy.tumblingWinPolicy(1);
    AggregateOperation1<Object, LongAccumulator, Long> aggrOp = counting();
    p = new SlidingWindowP<>(singletonList(entryKey()), singletonList((DistributedToLongFunction<Entry<?, Long>>) Entry::getValue), wDef, aggrOp, TimestampedEntry::new, true);
    Outbox outbox = new TestOutbox(128);
    Context context = new TestProcessorContext().setProcessingGuarantee(guarantee);
    p.init(outbox, context);
}
Also used : LongAccumulator(com.hazelcast.jet.accumulator.LongAccumulator) TestProcessorContext(com.hazelcast.jet.core.test.TestProcessorContext) Context(com.hazelcast.jet.core.Processor.Context) Entry(java.util.Map.Entry) TimestampedEntry(com.hazelcast.jet.datamodel.TimestampedEntry) SlidingWindowPolicy(com.hazelcast.jet.core.SlidingWindowPolicy) TestOutbox(com.hazelcast.jet.core.test.TestOutbox) Outbox(com.hazelcast.jet.core.Outbox) TestOutbox(com.hazelcast.jet.core.test.TestOutbox) TestProcessorContext(com.hazelcast.jet.core.test.TestProcessorContext)

Example 7 with Context

use of com.hazelcast.jet.core.Processor.Context in project hazelcast-jet by hazelcast.

the class StreamFilesPTest method initializeProcessor.

private void initializeProcessor(String glob) {
    if (glob == null) {
        glob = "*";
    }
    processor = new StreamFilesP(workDir.getAbsolutePath(), UTF_8, glob, 1, 0, Util::entry);
    outbox = new TestOutbox(1);
    Context ctx = new TestProcessorContext().setLogger(Logger.getLogger(StreamFilesP.class));
    processor.init(outbox, ctx);
}
Also used : TestProcessorContext(com.hazelcast.jet.core.test.TestProcessorContext) Context(com.hazelcast.jet.core.Processor.Context) TestOutbox(com.hazelcast.jet.core.test.TestOutbox) TestProcessorContext(com.hazelcast.jet.core.test.TestProcessorContext)

Example 8 with Context

use of com.hazelcast.jet.core.Processor.Context in project hazelcast by hazelcast.

the class StreamFilesPTest method initializeProcessor.

private void initializeProcessor(String glob) throws Exception {
    if (glob == null) {
        glob = "*";
    }
    processor = new StreamFilesP<>(workDir.getAbsolutePath(), UTF_8, glob, false, Util::entry);
    outbox = new TestOutbox(1);
    Context ctx = new TestProcessorContext().setLogger(Logger.getLogger(StreamFilesP.class));
    processor.init(outbox, ctx);
}
Also used : TestProcessorContext(com.hazelcast.jet.core.test.TestProcessorContext) Context(com.hazelcast.jet.core.Processor.Context) TestOutbox(com.hazelcast.jet.core.test.TestOutbox) TestProcessorContext(com.hazelcast.jet.core.test.TestProcessorContext)

Aggregations

Context (com.hazelcast.jet.core.Processor.Context)8 TestOutbox (com.hazelcast.jet.core.test.TestOutbox)6 TestProcessorContext (com.hazelcast.jet.core.test.TestProcessorContext)6 LongAccumulator (com.hazelcast.jet.accumulator.LongAccumulator)4 Outbox (com.hazelcast.jet.core.Outbox)4 Entry (java.util.Map.Entry)4 SlidingWindowPolicy (com.hazelcast.jet.core.SlidingWindowPolicy)2 FunctionEx (com.hazelcast.function.FunctionEx)1 Job (com.hazelcast.jet.Job)1 Traverser (com.hazelcast.jet.Traverser)1 Traversers (com.hazelcast.jet.Traversers)1 AggregateOperations.counting (com.hazelcast.jet.aggregate.AggregateOperations.counting)1 DAG (com.hazelcast.jet.core.DAG)1 EventTimeMapper (com.hazelcast.jet.core.EventTimeMapper)1 EventTimePolicy (com.hazelcast.jet.core.EventTimePolicy)1 DEFAULT_IDLE_TIMEOUT (com.hazelcast.jet.core.EventTimePolicy.DEFAULT_IDLE_TIMEOUT)1 ProcessorMetaSupplier (com.hazelcast.jet.core.ProcessorMetaSupplier)1 Vertex (com.hazelcast.jet.core.Vertex)1 TimestampedEntry (com.hazelcast.jet.datamodel.TimestampedEntry)1 SourceBuilder (com.hazelcast.jet.pipeline.SourceBuilder)1