Package org.graylog2.outputs
Class BatchedMessageFilterOutput
java.lang.Object
org.graylog2.outputs.BatchedMessageFilterOutput
- All Implemented Interfaces:
MessageOutput,Stoppable,GracefulShutdownHook
@Singleton
public class BatchedMessageFilterOutput
extends Object
implements MessageOutput, GracefulShutdownHook
A message output that filters incoming messages and writes batches of filtered messages to all
registered
FilteredMessageOutput outputs.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.graylog2.plugin.outputs.MessageOutput
MessageOutput.Config, MessageOutput.Descriptor, MessageOutput.Factory<T>, MessageOutput.Factory2<T> -
Constructor Summary
ConstructorsConstructorDescriptionBatchedMessageFilterOutput(Map<String, FilteredMessageOutput> outputs, OutputFilter outputFilter, com.codahale.metrics.MetricRegistry metricRegistry, Cluster cluster, MessageQueueAcknowledger acknowledger, IndexSetAwareMessageOutputBuffer indexSetAwareMessageOutputBuffer, GracefulShutdownService gracefulShutdownService, int outputFlushInterval, int shutdownTimeoutMs, ScheduledExecutorService daemonScheduler) -
Method Summary
Modifier and TypeMethodDescriptionvoidExecute shutdown tasks for the service that implements this interface.voidInitialize output, if not done in the constructor.booleanvoidstop()voidvoid
-
Constructor Details
-
Method Details
-
initialize
Description copied from interface:MessageOutputInitialize output, if not done in the constructor. Allows for graceful handling of initialization failures, e.g. because of an insufficient license. The output-launching code will call this method right after constructing the output instance.- Specified by:
initializein interfaceMessageOutput- Throws:
InsufficientLicenseException- if the output could not be initialized due to an insufficient license.Exception
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceMessageOutput
-
write
- Specified by:
writein interfaceMessageOutput- Throws:
Exception
-
write
- Specified by:
writein interfaceMessageOutput- Throws:
Exception
-
stop
public void stop() -
doGracefulShutdown
public void doGracefulShutdown()Description copied from interface:GracefulShutdownHookExecute shutdown tasks for the service that implements this interface.Warning:
- This method is called from another thread so the class that implements
GracefulShutdownHookmust be thread-safe. - The server shutdown is waiting for this method call to complete. Blocking this method will block the server shutdown!
- Specified by:
doGracefulShutdownin interfaceGracefulShutdownHook
- This method is called from another thread so the class that implements
-