Package com.arpnetworking.tsdcore.sinks
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
Modifier and TypeClassDescriptionstatic final class
Message class to wrap a list ofAggregatedData
.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
ConstructorDescriptionTcpSinkActor
(TcpSink sink, String serverAddress, int serverPort, int maximumQueueSize, Duration exponentialBackoffBase) Public constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pekko.actor.AbstractActor.Receive
void
postStop()
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.toString()
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, preStart, receive, receiveBuilder, self, sender, supervisorStrategy, unhandled
-
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
-
toLogValue
Generate a Steno log compatible representation.- Returns:
- Steno log compatible representation.
-
toString
-
createReceive
public org.apache.pekko.actor.AbstractActor.Receive createReceive()- Specified by:
createReceive
in classorg.apache.pekko.actor.AbstractActor
-
postStop
- Specified by:
postStop
in interfaceorg.apache.pekko.actor.Actor
- Overrides:
postStop
in classorg.apache.pekko.actor.AbstractActor
- Throws:
Exception
-