Class MultiSink

  • All Implemented Interfaces:
    ISink

    public class MultiSink
    extends java.lang.Object
    implements ISink
    Convenience helper for sinking the same log items to multiple destinations.

    Useful for debugging, sink to CloudWatch and console.

    • Constructor Summary

      Constructors 
      Constructor Description
      MultiSink()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(MetricsContext context)
      Accept MetricsContext to sink to CloudWatch.
      java.util.concurrent.CompletableFuture<java.lang.Void> shutdown()
      Shutdown the sink.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultiSink

        public MultiSink()
    • Method Detail

      • accept

        public void accept​(MetricsContext context)
        Description copied from interface: ISink
        Accept MetricsContext to sink to CloudWatch.
        Specified by:
        accept in interface ISink
        Parameters:
        context - MetricsContext
      • shutdown

        public java.util.concurrent.CompletableFuture<java.lang.Void> shutdown()
        Description copied from interface: ISink
        Shutdown the sink. The returned CompletableFuture will be completed when all queued events have been flushed. After this is called, no more metrics can be sent through this sink and attempting to continue to re-use the sink will result in undefined behavior.
        Specified by:
        shutdown in interface ISink
        Returns:
        a future that completes when the shutdown has completed successfully and all pending messages have been sent to the destination.