Package io.debezium.transforms
Class ScriptingTransformation<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
- java.lang.Object
-
- io.debezium.transforms.ScriptingTransformation<R>
-
- Type Parameters:
R- the subtype ofConnectRecordon which this transformation will operate
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.kafka.common.Configurable,org.apache.kafka.connect.transforms.Transformation<R>
- Direct Known Subclasses:
ContentBasedRouter,Filter
@Incubating public abstract class ScriptingTransformation<R extends org.apache.kafka.connect.connector.ConnectRecord<R>> extends Object implements org.apache.kafka.connect.transforms.Transformation<R>
This is a base class for any SMT using scripting languages. Current implementation supports only JSR223 scripting languages. The SMT will instantiate an scripting engine encapsulated inEngineinterface in configure phase. It will try to pre-parse the expression if it is allowed by the engine and than the expression is evaluated for every record incoming.The engine will extract key, value and its schemas and will inject them as variables into the engine. The mapping is unique for each expression language.
- Author:
- Jiri Pechanec
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScriptingTransformation.NullHandling
-
Field Summary
Fields Modifier and Type Field Description protected Engineengineprivate static StringGRAAL_JS_ENGINEprivate static StringJAVAX_SCRIPT_ENGINE_PREFIXstatic FieldLANGUAGEprivate org.slf4j.LoggerLOGGERstatic FieldNULL_HANDLINGprivate ScriptingTransformation.NullHandlingnullHandlingprivate static FieldTOPIC_REGEXprivate PatterntopicPattern
-
Constructor Summary
Constructors Constructor Description ScriptingTransformation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Rapply(R record)voidclose()org.apache.kafka.common.config.ConfigDefconfig()voidconfigure(Map<String,?> configs)protected abstract RdoApply(R record)protected abstract FieldexpressionField()
-
-
-
Field Detail
-
LOGGER
private final org.slf4j.Logger LOGGER
-
JAVAX_SCRIPT_ENGINE_PREFIX
private static final String JAVAX_SCRIPT_ENGINE_PREFIX
- See Also:
- Constant Field Values
-
GRAAL_JS_ENGINE
private static final String GRAAL_JS_ENGINE
- See Also:
- Constant Field Values
-
TOPIC_REGEX
private static final Field TOPIC_REGEX
-
LANGUAGE
public static final Field LANGUAGE
-
NULL_HANDLING
public static final Field NULL_HANDLING
-
engine
protected Engine engine
-
nullHandling
private ScriptingTransformation.NullHandling nullHandling
-
topicPattern
private Pattern topicPattern
-
-