Search in sources :

Example 21 with ProcessorMetaSupplier

use of com.hazelcast.jet.core.ProcessorMetaSupplier in project hazelcast-jet by hazelcast.

the class StreamFilesPTest method when_metaSupplier_then_returnsCorrectProcessors.

@Test
public void when_metaSupplier_then_returnsCorrectProcessors() {
    ProcessorMetaSupplier metaSupplier = streamFilesP(workDir.getAbsolutePath(), UTF_8, "*", Util::entry);
    Address a = new Address();
    ProcessorSupplier supplier = metaSupplier.get(singletonList(a)).apply(a);
    supplier.init(new TestProcessorContext());
    assertEquals(1, supplier.get(1).size());
    supplier.close(null);
}
Also used : Address(com.hazelcast.nio.Address) TestProcessorContext(com.hazelcast.jet.core.test.TestProcessorContext) IOUtil(com.hazelcast.nio.IOUtil) Util(com.hazelcast.jet.Util) ProcessorSupplier(com.hazelcast.jet.core.ProcessorSupplier) ProcessorMetaSupplier(com.hazelcast.jet.core.ProcessorMetaSupplier) Test(org.junit.Test)

Aggregations

ProcessorMetaSupplier (com.hazelcast.jet.core.ProcessorMetaSupplier)21 ProcessorSupplier (com.hazelcast.jet.core.ProcessorSupplier)11 Nonnull (javax.annotation.Nonnull)8 Test (org.junit.Test)6 Vertex (com.hazelcast.jet.core.Vertex)5 QuickTest (com.hazelcast.test.annotation.QuickTest)5 List (java.util.List)5 Address (com.hazelcast.cluster.Address)4 FunctionEx (com.hazelcast.function.FunctionEx)4 DAG (com.hazelcast.jet.core.DAG)4 TestProcessorContext (com.hazelcast.jet.core.test.TestProcessorContext)4 JetSqlRow (com.hazelcast.sql.impl.row.JetSqlRow)4 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)4 Map (java.util.Map)4 EventTimePolicy (com.hazelcast.jet.core.EventTimePolicy)3 Function (java.util.function.Function)3 Nullable (javax.annotation.Nullable)3 HazelcastInstance (com.hazelcast.core.HazelcastInstance)2 MemberInfo (com.hazelcast.internal.cluster.MemberInfo)2 EdgeConfig (com.hazelcast.jet.config.EdgeConfig)2