/** * Variant of {@link #forceTotalParallelismOne(ProcessorSupplier, String)} where the node * for the supplier will be chosen randomly. */ @Nonnull static ProcessorMetaSupplier forceTotalParallelismOne(@Nonnull ProcessorSupplier supplier) { return forceTotalParallelismOne(supplier, newUnsecureUuidString()); }
/** * Returns a supplier of processors for {@link Sources#jmsTopicBuilder}. */ @Nonnull public static <T> ProcessorMetaSupplier streamJmsTopicP( @Nonnull DistributedSupplier<? extends Connection> connectionSupplier, @Nonnull DistributedFunction<? super Connection, ? extends Session> sessionFn, @Nonnull DistributedFunction<? super Session, ? extends MessageConsumer> consumerFn, @Nonnull DistributedConsumer<? super Session> flushFn, @Nonnull DistributedFunction<? super Message, ? extends T> projectionFn, @Nonnull EventTimePolicy<? super T> eventTimePolicy) { return ProcessorMetaSupplier.forceTotalParallelismOne( StreamJmsP.supplier(connectionSupplier, sessionFn, consumerFn, flushFn, projectionFn, eventTimePolicy)); }
public static <T> ProcessorMetaSupplier supplier( @Nonnull String connectionURL, @Nonnull String query, @Nonnull DistributedFunction<? super ResultSet, ? extends T> mapOutputFn ) { return ProcessorMetaSupplier.forceTotalParallelismOne(ProcessorSupplier.of(() -> new ReadJdbcP<>( () -> DriverManager.getConnection(connectionURL), (connection, parallelism, index) -> { PreparedStatement statement = connection.prepareStatement(query); try { return statement.executeQuery(); } catch (SQLException e) { statement.close(); throw e; } }, mapOutputFn) )); }
public static ProcessorMetaSupplier metaSupplier(String listName, ClientConfig clientConfig) { String clientXml = asXmlString(clientConfig); return forceTotalParallelismOne( ProcessorSupplier.of(() -> { return new ReadIListP(listName, clientXml); }), listName ); } }
return preferredLocalParallelism > 0 ? ProcessorMetaSupplier.of(procSup, preferredLocalParallelism) : ProcessorMetaSupplier.forceTotalParallelismOne(procSup);
return preferredLocalParallelism != 0 ? ProcessorMetaSupplier.of(procSup, preferredLocalParallelism) : ProcessorMetaSupplier.forceTotalParallelismOne(procSup);