Class TcpSink

java.lang.Object
com.arpnetworking.tsdcore.sinks.BaseSink
com.arpnetworking.tsdcore.sinks.TcpSink
All Implemented Interfaces:
Sink
Direct Known Subclasses:
CarbonSink

public abstract class TcpSink extends BaseSink
Abstract publisher to send data to a server via Pekko TCP channel. This class leverages a TcpSinkActor to interact with the TCP channel.
Author:
Brandon Arp (brandonarp at gmail dot com)
  • Constructor Details

  • Method Details

    • close

      public void close()
      Called to allow the publisher to clean-up. No further calls to recordAggregation will be made after a call to close.
    • shutdownGracefully

      public CompletionStage<Void> shutdownGracefully()
      Description copied from interface: Sink
      Called to allow the publisher to clean-up. No further calls to recordAggregation will be made after a call to close.
      Returns:
      A CompletionStage that completes when the sink is closed.
    • toLogValue

      public Object toLogValue()
      Generate a Steno log compatible representation.
      Overrides:
      toLogValue in class BaseSink
      Returns:
      Steno log compatible representation.
    • recordAggregateData

      public void recordAggregateData(PeriodicData data)
      Called when additional PeriodicData instances are available for publication.
      Parameters:
      data - The {PeriodicData to be published.
    • serializeData

      protected abstract org.apache.pekko.util.ByteString serializeData(PeriodicData periodicData)
      Serialize a PeriodicData to binary.
      Parameters:
      periodicData - Data to serialize.
      Returns:
      ByteString representing the periodicData.
    • start

      protected void start(TcpSink.Builder<?,?> builder)
      Starts the actor for the sink. This is necessary to prevent references to 'this' from escaping the constructor.
      Parameters:
      builder - The builder used to create the sink.