Class Histogram.BucketBounds
- java.lang.Object
-
- org.apache.beam.sdk.extensions.combiners.Histogram.BucketBounds
-
- Enclosing class:
- Histogram
public abstract static class Histogram.BucketBounds extends java.lang.ObjectDefines the bounds for histogram buckets.Use the provided static factory methods to create new instances of
Histogram.BucketBounds.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Histogram.BucketBoundsexplicit(java.util.List<java.lang.Double> bounds)Likeexplicit(List, BoundsInclusivity), but sets BoundsInclusivity.LOWER_BOUND_INCLUSIVE_UPPER_BOUND_EXCLUSIVE value for the boundsInclusivity parameter.static Histogram.BucketBoundsexplicit(java.util.List<java.lang.Double> bounds, Histogram.BoundsInclusivity boundsInclusivity)Static factory method for defining bounds of explicit histogram.static Histogram.BucketBoundsexponential(double scale, double growthFactor, int numBoundedBuckets)Likeexponential(double, double, int, BoundsInclusivity), but sets BoundsInclusivity.LOWER_BOUND_INCLUSIVE_UPPER_BOUND_EXCLUSIVE value for the boundsInclusivity parameter.static Histogram.BucketBoundsexponential(double scale, double growthFactor, int numBoundedBuckets, Histogram.BoundsInclusivity boundsInclusivity)Static factory method for defining bounds of exponential histograms and calculating bounds based on the parameters.abstract java.util.List<java.lang.Double>getBounds()abstract Histogram.BoundsInclusivitygetBoundsInclusivity()static Histogram.BucketBoundslinear(double offset, double width, int numBoundedBuckets)Likelinear(double, double, int, BoundsInclusivity), but sets BoundsInclusivity.LOWER_BOUND_INCLUSIVE_UPPER_BOUND_EXCLUSIVE value for the boundsInclusivity parameter.static Histogram.BucketBoundslinear(double offset, double width, int numBoundedBuckets, Histogram.BoundsInclusivity boundsInclusivity)Static factory method for defining bounds of linear histogram and calculating bounds based on the parameters.
-
-
-
Method Detail
-
getBounds
public abstract java.util.List<java.lang.Double> getBounds()
-
getBoundsInclusivity
public abstract Histogram.BoundsInclusivity getBoundsInclusivity()
-
exponential
public static Histogram.BucketBounds exponential(double scale, double growthFactor, int numBoundedBuckets, Histogram.BoundsInclusivity boundsInclusivity)
Static factory method for defining bounds of exponential histograms and calculating bounds based on the parameters.For BoundsInclusivity.LOWER_BOUND_INCLUSIVE_UPPER_BOUND_EXCLUSIVE, the list that the HistogramCombineFn combiner returns contains the number of elements in the following buckets:
0-th: (-inf, scale) - underflow bucket 1-st: [scale, scale * growthFactor) 2-nd: [scale * growthFactor, scale * growthFactor^2) ... i-th: [scale * growthFactor^(i-1), scale * growthFactor^i) ... numBoundedBuckets: [scale * growthFactor^(numBoundedBuckets-1), scale * growthFactor^numBoundedBuckets) numBoundedBuckets + 1: [scale * growthFactor^numBoundedBuckets), +inf) - overflow bucket.
For BoundsInclusivity.LOWER_BOUND_EXCLUSIVE_UPPER_BOUND_INCLUSIVE, the list that the HistogramCombineFn combiner returns contains the number of elements in the following buckets:
0-th: (-inf, scale] - underflow bucket 1-st: (scale, scale * growthFactor] 2-nd: (scale * growthFactor, scale * growthFactor^2] ... i-th: (scale * growthFactor^(i-1), scale * growthFactor^i] ... numBoundedBuckets: (scale * growthFactor^(numBoundedBuckets-1), scale * growthFactor^numBoundedBuckets] numBoundedBuckets + 1: (scale * growthFactor^numBoundedBuckets), +inf) - overflow bucket.
- Parameters:
scale- the value of the lower bound for the first bounded bucket.growthFactor- value by which the bucket bounds are exponentially increased.numBoundedBuckets- integer determining the total number of bounded buckets within the histogram.boundsInclusivity- enum value which defines if lower or upper bounds are inclusive/exclusive.
-
exponential
public static Histogram.BucketBounds exponential(double scale, double growthFactor, int numBoundedBuckets)
Likeexponential(double, double, int, BoundsInclusivity), but sets BoundsInclusivity.LOWER_BOUND_INCLUSIVE_UPPER_BOUND_EXCLUSIVE value for the boundsInclusivity parameter.
-
linear
public static Histogram.BucketBounds linear(double offset, double width, int numBoundedBuckets, Histogram.BoundsInclusivity boundsInclusivity)
Static factory method for defining bounds of linear histogram and calculating bounds based on the parameters.- Parameters:
offset- value of the lower bound for the first bounded bucket.width- bucket width.numBoundedBuckets- integer determining the total number of bounded buckets within the histogram.boundsInclusivity- enum value which defines if lower or upper bounds are inclusive/exclusive.
-
linear
public static Histogram.BucketBounds linear(double offset, double width, int numBoundedBuckets)
Likelinear(double, double, int, BoundsInclusivity), but sets BoundsInclusivity.LOWER_BOUND_INCLUSIVE_UPPER_BOUND_EXCLUSIVE value for the boundsInclusivity parameter.
-
explicit
public static Histogram.BucketBounds explicit(java.util.List<java.lang.Double> bounds, Histogram.BoundsInclusivity boundsInclusivity)
Static factory method for defining bounds of explicit histogram.- Parameters:
bounds- array of explicit bounds of the buckets.boundsInclusivity- enum value which defines if lower or upper bounds are inclusive/exclusive.
-
explicit
public static Histogram.BucketBounds explicit(java.util.List<java.lang.Double> bounds)
Likeexplicit(List, BoundsInclusivity), but sets BoundsInclusivity.LOWER_BOUND_INCLUSIVE_UPPER_BOUND_EXCLUSIVE value for the boundsInclusivity parameter.
-
-