Skip to content

Commit

Permalink
Merge pull request #2852 from pomadchin/feature/histogram-api-cleanup
Browse files Browse the repository at this point in the history
Make histogram.merge methods more specific
  • Loading branch information
pomadchin authored and echeipesh committed Dec 28, 2018
1 parent 46ac87c commit 5610708
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class FastMapHistogram(_size: Int, _buckets: Array[Int], _counts: Array[Long], _
* the histogram that would result from seeing all of the values
* seen by the two antecedent histograms).
*/
def merge(histogram: Histogram[Int]): Histogram[Int] = {
def merge(histogram: Histogram[Int]): FastMapHistogram = {
val total = FastMapHistogram()

total.update(this); total.update(histogram)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ object StreamingHistogram {
size: Int,
minimumSeen: Double,
maximumSeen: Double
) =
): StreamingHistogram =
new StreamingHistogram(size, minimumSeen, maximumSeen)

def apply(other: Histogram[Double]): StreamingHistogram = {
Expand Down Expand Up @@ -396,7 +396,7 @@ class StreamingHistogram(
* the histogram that would result from seeing all of the values
* seen by the two antecedent histograms).
*/
def merge(histogram: Histogram[Double]): Histogram[Double] = {
def merge(histogram: Histogram[Double]): StreamingHistogram = {
val sh = StreamingHistogram(this.size, this._min, this._max)
sh.countItems(this.buckets)
histogram.foreach({ (item: Double, count: Long) => sh.countItem((item, count)) })
Expand Down

0 comments on commit 5610708

Please sign in to comment.