Package com.arpnetworking.tsdcore.sinks
Class HttpPostSinkActor
java.lang.Object
org.apache.pekko.actor.AbstractActor
org.apache.pekko.actor.AbstractActorWithTimers
com.arpnetworking.tsdcore.sinks.HttpPostSinkActor
- All Implemented Interfaces:
org.apache.pekko.actor.Actor
,org.apache.pekko.actor.Timers
public class HttpPostSinkActor
extends org.apache.pekko.actor.AbstractActorWithTimers
Actor that sends HTTP requests via a Ning HTTP client.
- Author:
- Brandon Arp (brandon dot arp at inscopemetrics dot io)
-
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
ConstructorDescriptionHttpPostSinkActor
(org.asynchttpclient.AsyncHttpClient client, HttpPostSink sink, int maximumConcurrency, int maximumQueueSize, Duration spreadPeriod, com.arpnetworking.metrics.incubator.PeriodicMetrics periodicMetrics) Public constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pekko.actor.AbstractActor.Receive
void
postStop()
void
preRestart
(Throwable reason, Optional<Object> message) void
preStart()
static org.apache.pekko.actor.Props
props
(org.asynchttpclient.AsyncHttpClient client, HttpPostSink sink, int maximumConcurrency, int maximumQueueSize, Duration spreadPeriod, com.arpnetworking.metrics.incubator.PeriodicMetrics periodicMetrics) Factory method to create a Props.Generate a Steno log compatible representation.toString()
Methods inherited from class org.apache.pekko.actor.AbstractActorWithTimers
aroundPostStop, aroundPreRestart, aroundReceive, getTimers, org$apache$pekko$actor$Timers$_setter_$org$apache$pekko$actor$Timers$$_timers_$eq, org$apache$pekko$actor$Timers$$_timers, timers
Methods inherited from class org.apache.pekko.actor.AbstractActor
aroundPostRestart, aroundPreStart, context, emptyBehavior, getContext, getSelf, getSender, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, preRestart, receive, receiveBuilder, self, sender, supervisorStrategy, unhandled
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.pekko.actor.Actor
aroundPostRestart, aroundPreStart, context, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, preRestart, receive, self, sender, supervisorStrategy, unhandled
-
Constructor Details
-
HttpPostSinkActor
public HttpPostSinkActor(org.asynchttpclient.AsyncHttpClient client, HttpPostSink sink, int maximumConcurrency, int maximumQueueSize, Duration spreadPeriod, com.arpnetworking.metrics.incubator.PeriodicMetrics periodicMetrics) Public constructor.- Parameters:
client
- Http client to create requests from.sink
- Sink that controls request creation and data serialization.maximumConcurrency
- Maximum number of concurrent requests.maximumQueueSize
- Maximum number of pending requests.spreadPeriod
- Maximum time to delay sending new aggregates to spread load.periodicMetrics
- Periodic Metrics to record metrics for the actor.
-
-
Method Details
-
props
public static org.apache.pekko.actor.Props props(org.asynchttpclient.AsyncHttpClient client, HttpPostSink sink, int maximumConcurrency, int maximumQueueSize, Duration spreadPeriod, com.arpnetworking.metrics.incubator.PeriodicMetrics periodicMetrics) Factory method to create a Props.- Parameters:
client
- Http client to create requests from.sink
- Sink that controls request creation and data serialization.maximumConcurrency
- Maximum number of concurrent requests.maximumQueueSize
- Maximum number of pending requests.spreadPeriod
- Maximum time to delay sending new aggregates to spread load.periodicMetrics
- Periodic Metrics to record metrics for the actor.- Returns:
- A new Props
-
preStart
- Specified by:
preStart
in interfaceorg.apache.pekko.actor.Actor
- Overrides:
preStart
in classorg.apache.pekko.actor.AbstractActor
- Throws:
Exception
-
postStop
- Specified by:
postStop
in interfaceorg.apache.pekko.actor.Actor
- Overrides:
postStop
in classorg.apache.pekko.actor.AbstractActor
- Throws:
Exception
-
preRestart
- Overrides:
preRestart
in classorg.apache.pekko.actor.AbstractActor
- Throws:
Exception
-
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
-