Class TcpSinkActor

java.lang.Object
org.apache.pekko.actor.AbstractActor
com.arpnetworking.tsdcore.sinks.TcpSinkActor
All Implemented Interfaces:
org.apache.pekko.actor.Actor

public class TcpSinkActor extends org.apache.pekko.actor.AbstractActor
Actor that sends TCP data with Pekko.
Author:
Brandon Arp (brandon dot arp at inscopemetrics dot com)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Message class to drain the queue and shutdown the actor.
    static final class 
    Message class to wrap a list of AggregatedData.

    Nested classes/interfaces inherited from class org.apache.pekko.actor.AbstractActor

    org.apache.pekko.actor.AbstractActor.ActorContext, org.apache.pekko.actor.AbstractActor.Receive

    Nested classes/interfaces inherited from interface org.apache.pekko.actor.Actor

    org.apache.pekko.actor.Actor.emptyBehavior$, org.apache.pekko.actor.Actor.ignoringBehavior$
  • Constructor Summary

    Constructors
    Constructor
    Description
    TcpSinkActor(TcpSink sink, String serverAddress, int serverPort, int maximumQueueSize, Duration exponentialBackoffBase)
    Public constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.pekko.actor.AbstractActor.Receive
     
    void
    void
     
    static org.apache.pekko.actor.Props
    props(TcpSink sink, String serverAddress, int serverPort, int maximumQueueSize, Duration exponentialBackoffBase)
    Factory method to create a Props.
    Generate a Steno log compatible representation.

    Methods inherited from class org.apache.pekko.actor.AbstractActor

    aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, emptyBehavior, getContext, getSelf, getSender, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, preRestart, preRestart, receive, receiveBuilder, self, sender, supervisorStrategy, unhandled

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TcpSinkActor

      public TcpSinkActor(TcpSink sink, String serverAddress, int serverPort, int maximumQueueSize, Duration exponentialBackoffBase)
      Public constructor.
      Parameters:
      sink - Sink that controls request creation and data serialization.
      serverAddress - Server to connect to.
      serverPort - Port to connect to.
      maximumQueueSize - Maximum number of pending requests.
      exponentialBackoffBase - Milliseconds as the base as the connection exponential backoff.
  • Method Details

    • props

      public static org.apache.pekko.actor.Props props(TcpSink sink, String serverAddress, int serverPort, int maximumQueueSize, Duration exponentialBackoffBase)
      Factory method to create a Props.
      Parameters:
      sink - Sink that controls request creation and data serialization.
      serverAddress - Server to connect to.
      serverPort - Port to connect to.
      maximumQueueSize - Maximum number of pending requests.
      exponentialBackoffBase - Milliseconds as the base as the connection exponential backoff.
      Returns:
      A new Props
    • preStart

      public void preStart() throws Exception
      Specified by:
      preStart in interface org.apache.pekko.actor.Actor
      Overrides:
      preStart in class org.apache.pekko.actor.AbstractActor
      Throws:
      Exception
    • toLogValue

      public Object toLogValue()
      Generate a Steno log compatible representation.
      Returns:
      Steno log compatible representation.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createReceive

      public org.apache.pekko.actor.AbstractActor.Receive createReceive()
      Specified by:
      createReceive in class org.apache.pekko.actor.AbstractActor
    • postStop

      public void postStop() throws Exception
      Specified by:
      postStop in interface org.apache.pekko.actor.Actor
      Overrides:
      postStop in class org.apache.pekko.actor.AbstractActor
      Throws:
      Exception