Package com.hazelcast.jet.python
Class PythonTransforms
java.lang.Object
com.hazelcast.jet.python.PythonTransforms
Transforms which allow the user to call Python user-defined functions
from inside a Jet pipeline.
- Since:
- Jet 4.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K> FunctionEx<StreamStage<String>,
StreamStage<String>> mapUsingPython
(FunctionEx<? super String, ? extends K> keyFn, PythonServiceConfig cfg) Deprecated.static FunctionEx<StreamStage<String>,
StreamStage<String>> A stage-transforming method that adds a "map using Python" pipeline stage.static FunctionEx<StreamStage<String>,
StreamStage<String>> mapUsingPython
(PythonServiceConfig cfg, int maxBatchSize) A stage-transforming method that adds a "map using Python" pipeline stage.static <K> FunctionEx<BatchStage<String>,
BatchStage<String>> mapUsingPythonBatch
(FunctionEx<? super String, ? extends K> keyFn, PythonServiceConfig cfg) Deprecated.Jet now has first-class support for data rebalancing, seeGeneralStage.rebalance()
andGeneralStage.rebalance(FunctionEx)
.static FunctionEx<BatchStage<String>,
BatchStage<String>> A stage-transforming method that adds a "map using Python" pipeline stage.static FunctionEx<BatchStage<String>,
BatchStage<String>> mapUsingPythonBatch
(PythonServiceConfig cfg, int maxBatchSize) A stage-transforming method that adds a "map using Python" pipeline stage.
-
Method Details
-
mapUsingPython
@Nonnull public static FunctionEx<StreamStage<String>,StreamStage<String>> mapUsingPython(@Nonnull PythonServiceConfig cfg) A stage-transforming method that adds a "map using Python" pipeline stage. Use it withstage.apply(PythonService.mapUsingPython(pyConfig))
. SeePythonServiceConfig
for more details. -
mapUsingPython
@Nonnull public static FunctionEx<StreamStage<String>,StreamStage<String>> mapUsingPython(@Nonnull PythonServiceConfig cfg, int maxBatchSize) A stage-transforming method that adds a "map using Python" pipeline stage. Use it withstage.apply(PythonService.mapUsingPython(pyConfig))
. SeePythonServiceConfig
for more details.The
maxBatchSize
may be used to limit the size of a single request to the Python service.- Parameters:
cfg
- configuration for the Python servicemaxBatchSize
- the maximum size of a batch for a single request
-
mapUsingPython
@Deprecated @Nonnull public static <K> FunctionEx<StreamStage<String>,StreamStage<String>> mapUsingPython(@Nonnull FunctionEx<? super String, ? extends K> keyFn, @Nonnull PythonServiceConfig cfg) Deprecated.Jet now has first-class support for data rebalancing, seeGeneralStage.rebalance()
andGeneralStage.rebalance(FunctionEx)
.A stage-transforming method that adds a partitioned "map using Python" pipeline stage. It applies partitioning using the suppliedkeyFn
. You need partitioning if your input stream comes from a non-distributed data source (all data coming in on a single cluster member), in order to distribute the Python work across the whole cluster.Use it like this:
stage.apply(PythonService.mapUsingPython(keyFn, pyConfig))
. SeePythonServiceConfig
for more details. -
mapUsingPythonBatch
@Nonnull public static FunctionEx<BatchStage<String>,BatchStage<String>> mapUsingPythonBatch(@Nonnull PythonServiceConfig cfg) A stage-transforming method that adds a "map using Python" pipeline stage. Use it withstage.apply(PythonService.mapUsingPythonBatch(pyConfig))
. SeePythonServiceConfig
for more details. -
mapUsingPythonBatch
@Nonnull public static FunctionEx<BatchStage<String>,BatchStage<String>> mapUsingPythonBatch(@Nonnull PythonServiceConfig cfg, int maxBatchSize) A stage-transforming method that adds a "map using Python" pipeline stage. Use it withstage.apply(PythonService.mapUsingPythonBatch(pyConfig))
. SeePythonServiceConfig
for more details.The
maxBatchSize
may be used to limit the size of a single request to the Python service.- Parameters:
cfg
- configuration for the Python servicemaxBatchSize
- the maximum size of a batch for a single request
-
mapUsingPythonBatch
@Nonnull @Deprecated public static <K> FunctionEx<BatchStage<String>,BatchStage<String>> mapUsingPythonBatch(@Nonnull FunctionEx<? super String, ? extends K> keyFn, @Nonnull PythonServiceConfig cfg) Deprecated.Jet now has first-class support for data rebalancing, seeGeneralStage.rebalance()
andGeneralStage.rebalance(FunctionEx)
.A stage-transforming method that adds a partitioned "map using Python" pipeline stage. It applies partitioning using the suppliedkeyFn
. You need partitioning if your input stream comes from a non-distributed data source (all data coming in on a single cluster member), in order to distribute the Python work across the whole cluster.Use it like this:
stage.apply(PythonService.mapUsingPythonBatch(keyFn, pyConfig))
. SeePythonServiceConfig
for more details.
-
GeneralStage.rebalance()
andGeneralStage.rebalance(FunctionEx)
.