Skip to content

Fix cache bug in stats module#5650

Merged
jihoonson merged 1 commit intoapache:masterfrom
drcrallen:variance/cachefix
Apr 17, 2018
Merged

Fix cache bug in stats module#5650
jihoonson merged 1 commit intoapache:masterfrom
drcrallen:variance/cachefix

Conversation

@drcrallen
Copy link
Copy Markdown
Contributor

@drcrallen drcrallen commented Apr 16, 2018

#2525 introduced the stats module, but it had some bugs in the cache keys, hash codes, and toString methods.

  • Use CacheKeyBuilder
  • Remove unused reset method
  • auto-gen hash key, to string, and equals methods.

return new CacheKeyBuilder(AggregatorUtil.VARIANCE_CACHE_TYPE_ID)
.appendString(fieldName)
.appendString(inputType)
.appendBoolean(isVariancePop)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: isVariancePop is not necessary in getCacheKey(), equals(), and hashCode() because it is decided based on estimator.

@jihoonson jihoonson merged commit 8e441cd into apache:master Apr 17, 2018
@drcrallen drcrallen deleted the variance/cachefix branch April 20, 2018 20:21
sathishsri88 pushed a commit to sathishs/druid that referenced this pull request May 8, 2018
@jihoonson jihoonson added this to the 0.12.2 milestone Jul 5, 2018
jihoonson pushed a commit to implydata/druid-public that referenced this pull request Jul 6, 2018
jihoonson pushed a commit to jihoonson/druid that referenced this pull request Jul 6, 2018
gianm pushed a commit that referenced this pull request Jul 9, 2018
leventov pushed a commit to metamx/druid that referenced this pull request Jul 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants