Class HttpPostSink.Builder<B extends BaseSink.Builder<B,S>,S extends HttpPostSink>

java.lang.Object
com.arpnetworking.commons.builder.OvalBuilder<S>
com.arpnetworking.tsdcore.sinks.BaseSink.Builder<B,S>
com.arpnetworking.tsdcore.sinks.HttpPostSink.Builder<B,S>
Type Parameters:
B - type of the builder
S - type of the object to be built
All Implemented Interfaces:
com.arpnetworking.commons.builder.Builder<S>
Direct Known Subclasses:
AggregationServerHttpSink.Builder
Enclosing class:
HttpPostSink

public abstract static class HttpPostSink.Builder<B extends BaseSink.Builder<B,S>,S extends HttpPostSink> extends BaseSink.Builder<B,S>
Implementation of abstract builder pattern for HttpPostSink.
Author:
Ville Koskela (ville dot koskela at inscopemetrics dot io)
  • Constructor Details

    • Builder

      protected Builder(Function<B,S> targetConstructor)
      Protected constructor for subclasses.
      Parameters:
      targetConstructor - The constructor for the concrete type to be created by this builder.
  • Method Details

    • setUri

      public B setUri(URI value)
      The URI to post the aggregated data to. Cannot be null.
      Parameters:
      value - The URI to post the aggregated data to.
      Returns:
      This instance of HttpPostSink.Builder.
    • setActorSystem

      public B setActorSystem(org.apache.pekko.actor.ActorSystem value)
      Sets the actor system to create the sink actor in. Required. Cannot be null. Injected by default.
      Parameters:
      value - the actor system
      Returns:
      this builder
    • setMaximumConcurrency

      public B setMaximumConcurrency(Integer value)
      Sets the maximum concurrency of the http requests. Optional. Cannot be null. Default is 1. Minimum is 1.
      Parameters:
      value - the maximum concurrency
      Returns:
      this builder
    • setSpreadPeriod

      public B setSpreadPeriod(Duration value)
      Sets the maximum delay before starting to send data to the server. Optional. Cannot be null. Default is 0.
      Parameters:
      value - the maximum delay before sending new data
      Returns:
      this builder
    • setMaximumQueueSize

      public B setMaximumQueueSize(Integer value)
      Sets the maximum pending queue size. Optional Cannot be null. Default is 25000. Minimum is 1.
      Parameters:
      value - the maximum pending queue size
      Returns:
      this builder
    • setPeriodicMetrics

      public B setPeriodicMetrics(com.arpnetworking.metrics.incubator.PeriodicMetrics value)
      Instance of PeriodicMetrics. Cannot be null. This field may be injected automatically by Jackson/Guice if setup to do so.
      Parameters:
      value - Instance of PeriodicMetrics.
      Returns:
      This instance of HttpPostSink.Builder.
    • setAcceptedStatusCodes

      public B setAcceptedStatusCodes(com.google.common.collect.ImmutableSet<Integer> value)
      Sets the http status codes accepted as success. Optional. Cannot be null. Default is: [200, 201, 202, 204]
      Parameters:
      value - the status codes accepted as success
      Returns:
      this builder