Skip to content


UserFunctionLoader uses Function Loaders to loadFunctions.

Creating Instance

UserFunctionLoader takes the following to be created:

  • MutableFunctionRegistry
  • Plugin Directory
  • Parent ClassLoader
  • blacklist
  • Metrics
  • loadCustomerUdfs flag

UserFunctionLoader is created when:

  • UdfLoaderUtil is requested to load
  • UserFunctionLoader is requested to newInstance

Function Loaders

UserFunctionLoader creates the function loaders when created:

The loaders are used to loadFunctions.

Creating UserFunctionLoader

UserFunctionLoader newInstance(
  KsqlConfig config,
  MutableFunctionRegistry metaStore,
  String ksqlInstallDir,
  Metrics metricsRegistry)

With enabled, newInstance sets the System security as ExtensionSecurityManager.

In the end, newInstance creates a UserFunctionLoader with the following:

newInstance is used when:

Loading Function Jars

void load()

load loadFunctions.

With loadCustomerUdfs enabled, load finds all the jar files in the pluginDir and loadFunctions for every jar file (unless blacklisted).

load is used when:


void loadFunctions(
  ClassLoader loader,
  Optional<Path> path)


loadFunctions uses ClassGraph library to scan the classpath.

loadFunctions finds classes with the function annotations and uses the UdfLoader to load them.

Annotation Loader
UdfDescription UdfLoader
UdafDescription UdafLoader
UdtfDescription UdtfLoader


Enable ALL logging level for io.confluent.ksql.function.UserFunctionLoader logger to see what happens inside.

Add the following line to config/

Refer to Logging.