Java filters

What are Java filters?

The easiest way to create filters in Gallium Data is with JavaScript code: you can edit the code on the fly, your changes take effect immediately, etc...

However, JavaScript filters have one downside: they are interpreted at runtime, which implies a certain penalty performance. The underlying JavaScript engine (GraalVM) is very good at optimizing the execution of this code, but when performance is truly critical, there is a more performant (and significantly less convenient) option: writing a filter in Java.

A Java filter consists of two parts:

  • one or more Java classes, compiled and packaged into a jar file (you can of course combine multiple filters in one jar file)

  • a JSON file describing this filter and how it can be configured

The Java API for Java filters is described in the Javadoc documentation.

The best way to create a Java filter is to start with the sample project.