public interface TraceEventFlusher
Interface to be implemented by a user-supplied class, handling the writing of
trace events to external storage. The implementation will be instantiated
by Variant and is bound to a particular Variant schema. The implementation is defined
meta/flusher schema property. If no flusher is supplied in the schema,
Variant will used the server-wide default, as defined by
The implementation should expect Variant
server to periodically call
flush(Collection) with a collection of
ready to be flushed. The frequency of this call and the likely number of events in the collection depend
on the rate of event production and the following system properties:
variant.event.writer.buffer.size: The maximum number of pending events that can be held in memory by the event writer. (Default = 20,000). If the rate of event production is too high and the event flusher can't keep up, new events will be discarded with the appropriate error message in the server's log.
variant.event.writer.max.delay: The maximum delay, in seconds, a pending event will be held in memory. (Default = 30) If the rate of event production is too low, pending events may be stuck in memory for too long, risking being lost in the event of a server crash, or delaying a critical action further down the data pipeline. This property will force the event writer to flush pending events even if a large portion of the event buffer is still free.
An implementation must provide at least one public constructor:
Variant creates a new instance of the implementation class for each schema where it is defined.
void flush(java.util.Collection<FlushableTraceEvent> events) throws java.lang.Exception
Called by the server, whenever the asynchronous event writer needs to flush events from memory.
events- A collection of decorated trace events
FlushableTraceEventto be written off. The size of the collection may be up to the size defined by the variant.event.writer.buffer.size configuration property.
Variant Experience Server release 0.9.3. Updated 06 Dec 2018.
Copyright © 2018 Variant Inc.