T
- the item class typepublic final class GenericPartitionBoundaries<T> extends Object
Constructor and Description |
---|
GenericPartitionBoundaries(long totalN,
T[] boundaries,
long[] natRanks,
double[] normRanks,
T maxItem,
T minItem,
QuantileSearchCriteria searchCrit)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
T[] |
getBoundaries()
Gets an ordered array of boundaries that sequentially define the upper and lower boundaries of partitions.
|
T |
getMaxItem()
Returns the maximum item of the stream.
|
T |
getMinItem()
Returns the minimum item of the stream.
|
long |
getN()
Gets the length of the input stream offered to the underlying sketch.
|
long[] |
getNaturalRanks()
Gets an ordered array of natural ranks of the associated array of partition boundaries utilizing
a specified search criterion.
|
double[] |
getNormalizedRanks()
Gets an ordered array of normalized ranks of the associated array of partition boundaries utilizing
a specified search criterion.
|
long[] |
getNumDeltaItems()
Gets the number of items to be included for each partition as an array.
|
int |
getNumPartitions()
Gets the number of partitions
|
QuantileSearchCriteria |
getSearchCriteria()
Gets the search criteria specified for the source sketch
|
public GenericPartitionBoundaries(long totalN, T[] boundaries, long[] natRanks, double[] normRanks, T maxItem, T minItem, QuantileSearchCriteria searchCrit)
totalN
- the total number of items input to the sketch.boundaries
- The quantile boundaries between partitionsnatRanks
- The array of natural Ranks corresponding to the array of boundaries.normRanks
- The normalized Ranks corresponding to the array of boundaries.maxItem
- the maximum item of the stream.minItem
- the minimum item of the stream.searchCrit
- the user defined search criteriapublic long getN()
public T[] getBoundaries()
Assume boundaries array has size N + 1. Let the indicies be sequentially numbered from 0 to N. The number of partitions is always one less than the size of the boundaries array. Let the the partitions be sequentially numbered from 1 to N.
If these results were computed using QuantileSearchCriteria.INCLUSIVE then these sequential boundaries are to be interpreted as follows:
If these results were computed using QuantileSearchCriteria.EXCLUSIVE then these sequential boundaries are to be interpreted as follows:
public long[] getNaturalRanks()
public double[] getNormalizedRanks()
public long[] getNumDeltaItems()
public int getNumPartitions()
public T getMaxItem()
IllegalArgumentException
- if sketch is empty.public T getMinItem()
IllegalArgumentException
- if sketch is empty.public QuantileSearchCriteria getSearchCriteria()
Copyright © 2015–2024 The Apache Software Foundation. All rights reserved.