Package com.arpnetworking.tsdcore.sinks
Class PeriodicStatisticsSink.Builder
java.lang.Object
com.arpnetworking.commons.builder.OvalBuilder<S>
com.arpnetworking.tsdcore.sinks.BaseSink.Builder<PeriodicStatisticsSink.Builder,PeriodicStatisticsSink>
com.arpnetworking.tsdcore.sinks.PeriodicStatisticsSink.Builder
- All Implemented Interfaces:
com.arpnetworking.commons.builder.Builder<PeriodicStatisticsSink>
- Enclosing class:
- PeriodicStatisticsSink
public static final class PeriodicStatisticsSink.Builder
extends BaseSink.Builder<PeriodicStatisticsSink.Builder,PeriodicStatisticsSink>
Implementation of builder pattern for
PeriodicStatisticsSink
.- Author:
- Ville Koskela (ville dot koskela at inscopemetrics dot io)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected PeriodicStatisticsSink.Builder
self()
Called by setters to always return appropriate subclass ofBaseSink.Builder
, even from setters of base class.setDefaultDimensionsValues
(com.google.common.collect.ImmutableMap<String, String> value) Supply default dimension values by original dimension key.setDimensions
(com.google.common.collect.ImmutableSet<String> value) Dimension names to partition the periodic statistics on.setIntervalInMilliseconds
(Long value) The interval in milliseconds between statistic flushes.setMappedDimensions
(com.google.common.collect.ImmutableMap<String, String> value) Incoming dimension names to partition the periodic statistics on mapped to an outbound dimension name.setMetricsFactory
(com.arpnetworking.metrics.MetricsFactory value) Instance ofMetricsFactory
.setPeriodDimensionName
(String value) The name of the outbound dimension for the periodicity of the data.Methods inherited from class com.arpnetworking.tsdcore.sinks.BaseSink.Builder
setName
Methods inherited from class com.arpnetworking.commons.builder.OvalBuilder
build, clone, clone, construct, isSelfValidating, toString, validate
-
Constructor Details
-
Builder
public Builder()Public constructor.
-
-
Method Details
-
setIntervalInMilliseconds
The interval in milliseconds between statistic flushes. Cannot be null; minimum 1. Default is 1.- Parameters:
value
- The interval in seconds between flushes.- Returns:
- This instance of
PeriodicStatisticsSink.Builder
.
-
setDimensions
public PeriodicStatisticsSink.Builder setDimensions(com.google.common.collect.ImmutableSet<String> value) Dimension names to partition the periodic statistics on. Cannot be null. Default is empty set (no dimension partitions). These dimensions create a target dimension on the periodic data of the same name. These output dimension names are not allowed to overlap between those specified (implicitly) viasetDimensions(ImmutableSet)
and (explicitly) viasetMappedDimensions(ImmutableMap)
. Doing so will cause a validation failure. Further, the output dimension names must be distinct from the period dimension name set bysetPeriodDimensionName(String)
and which defaults to "_period".- Parameters:
value
- The set of dimension names to partition on.- Returns:
- This instance of
PeriodicStatisticsSink.Builder
.
-
setMappedDimensions
public PeriodicStatisticsSink.Builder setMappedDimensions(com.google.common.collect.ImmutableMap<String, String> value) Incoming dimension names to partition the periodic statistics on mapped to an outbound dimension name. Cannot be null. Default is empty map (no dimension partitions). These dimensions create a target dimension on the periodic data of the specified name. These output dimension names are not allowed to overlap between those specified (implicitly) viasetDimensions(ImmutableSet)
and (explicitly) viasetMappedDimensions(ImmutableMap)
. Doing so will cause a validation failure. Further, the output dimension names must be distinct from the period dimension name set bysetPeriodDimensionName(String)
and which defaults to "_period".- Parameters:
value
- The set of dimension names to partition on.- Returns:
- This instance of
PeriodicStatisticsSink.Builder
.
-
setDefaultDimensionsValues
public PeriodicStatisticsSink.Builder setDefaultDimensionsValues(com.google.common.collect.ImmutableMap<String, String> value) Supply default dimension values by original dimension key. The keys in this map must also be specified either insetDimensions(ImmutableSet)
or as keys insetMappedDimensions(ImmutableMap)
. The key refers to the dimension name on the inputPeriodicData
.- Parameters:
value
- The default dimension key-value pairs.- Returns:
- This instance of
PeriodicStatisticsSink.Builder
.
-
setPeriodDimensionName
The name of the outbound dimension for the periodicity of the data. Cannot be null. Default is "_period".- Parameters:
value
- The name of the outbound dimension for periodicity.- Returns:
- This instance of
PeriodicStatisticsSink.Builder
.
-
setMetricsFactory
public PeriodicStatisticsSink.Builder setMetricsFactory(com.arpnetworking.metrics.MetricsFactory value) Instance ofMetricsFactory
. Cannot be null. This field may be injected automatically by Jackson/Guice if setup to do so.- Parameters:
value
- Instance ofMetricsFactory
.- Returns:
- This instance of
PeriodicStatisticsSink.Builder
.
-
self
Description copied from class:BaseSink.Builder
Called by setters to always return appropriate subclass ofBaseSink.Builder
, even from setters of base class.- Specified by:
self
in classBaseSink.Builder<PeriodicStatisticsSink.Builder,
PeriodicStatisticsSink> - Returns:
- instance with correct
BaseSink.Builder
class type.
-