Class CelExecutor
java.lang.Object
io.confluent.kafka.schemaregistry.rules.cel.CelExecutor
- All Implemented Interfaces:
RuleBase,RuleExecutor,AutoCloseable,org.apache.kafka.common.Configurable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classPre-converted CEL invocation context. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringSelects the regex engine used by the CELmatches/matches_stringoverloads.static final StringFields inherited from interface io.confluent.kafka.schemaregistry.rules.RuleBase
DEFAULT_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CelExecutor.BindingsInspect the boundmessageto decide ScriptType, then convert every arg to its CEL-friendly shape.voidprotected Objectevaluate(RuleContext ctx, String rule, CelExecutor.Bindings b) Look up (or compile) the program forruleand run it against the pre-converted args inb.protected ObjectApply the optional guard (everything before the first;in the rule expression) and then evaluate the body.protected ObjectEntry point used byCelFieldExecutorand any subclass that wants the full guard-then-body flow.transform(RuleContext ctx, Object message) type()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.confluent.kafka.schemaregistry.rules.RuleBase
addOriginalConfigs, close, setSchemaRegistryClient
-
Field Details
-
TYPE
- See Also:
-
CEL_IGNORE_GUARD_SEPARATOR
- See Also:
-
CEL_REGEX_ENGINE
Selects the regex engine used by the CELmatches/matches_stringoverloads. Values:"pcre"(Pattern, supports lookahead and other PCRE features) or"re2"(cel-java's stdlib choice, linear-time matching, no lookahead). Resolvable per-rule viaparams.cel.regex.engineor globally via the executor config; unconfigured falls back toCelUtils.RegexEngine.DEFAULT.- See Also:
-
-
Constructor Details
-
CelExecutor
public CelExecutor()
-
-
Method Details
-
configure
-
type
-
transform
- Specified by:
transformin interfaceRuleExecutor- Throws:
RuleException
-
execute
Entry point used byCelFieldExecutorand any subclass that wants the full guard-then-body flow. Equivalent tobind→evaluateWithGuard.- Throws:
RuleException
-
bind
protected CelExecutor.Bindings bind(RuleContext ctx, Object obj, Map<String, Object> args) throws RuleExceptionInspect the boundmessageto decide ScriptType, then convert every arg to its CEL-friendly shape. The returnedCelExecutor.Bindingsis reusable across multipleevaluatecalls (e.g., guard then body) — only the rule expression changes between them. Returnsnullif the message is a List (not a supported CEL binding shape).- Throws:
RuleException
-
evaluateWithGuard
Apply the optional guard (everything before the first;in the rule expression) and then evaluate the body. Reusesbfor both — only the rule expression (and therefore the cache key) differs.- Throws:
RuleException
-
evaluate
protected Object evaluate(RuleContext ctx, String rule, CelExecutor.Bindings b) throws RuleException Look up (or compile) the program forruleand run it against the pre-converted args inb.- Throws:
RuleException
-