Interface CompactionKeyExtractor<X>

  • Type Parameters:
    X - The (Java) type of objects for which the compaction key will be computed.
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface CompactionKeyExtractor<X>
    This is a functional interface to be implemented by applications which want to produce compacted events. In many cases it's possible to implement this with a method reference to a getter (like Order::getNumber), in more complex cases it's usually still possible as a one-line Lambda.
    See Also:
    EventLogWriter.registerCompactionKeyExtractor(String, Class, CompactionKeyExtractor)
    • Method Detail

      • getCompactionKeyFor

        String getCompactionKeyFor​(X data)
        Extracts a compaction key of a data object.
        Parameters:
        data - The data/payload to be sent in the event.
        Returns:
        the compaction key to be written in the metadata.