Skip to content

Commit

Permalink
Merge pull request #255 from twitter/alexlevenson/bump-deps
Browse files Browse the repository at this point in the history
Use latest scalding, algebird, and bijection versions
  • Loading branch information
ianoc committed Feb 4, 2015
2 parents 7c83fe8 + e3137ac commit 05d9803
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ object StorehausBuild extends Build {
.filterNot(unreleasedModules.contains(_))
.map { s => "com.twitter" % ("storehaus-" + s + "_2.10") % "0.10.0" }

val algebirdVersion = "0.8.2"
val bijectionVersion = "0.7.0"
val algebirdVersion = "0.9.0"
val bijectionVersion = "0.7.2"
val utilVersion = "6.22.0"
val scaldingVersion = "0.11.1"
val scaldingVersion = "0.13.0"
lazy val storehaus = Project(

id = "storehaus",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.twitter.storehaus.cache

import com.twitter.algebird.{ Semigroup, Monoid, Group, CMSHash }
import com.twitter.algebird.{ Semigroup, Monoid, Group, CMSHash, CMSHasherImplicits}
import com.twitter.util.Future


Expand All @@ -41,6 +41,8 @@ object HeavyHittersPercent {
}

sealed class ApproxHHTracker[K](hhPct: HeavyHittersPercent, updateFreq: WriteOperationUpdateFrequency, roFreq: RollOverFrequencyMS) {
import CMSHasherImplicits._

private[this] final val WIDTH = 1000
private[this] final val DEPTH = 4
private[this] final val hh = new java.util.HashMap[K, Long]()
Expand All @@ -53,9 +55,9 @@ sealed class ApproxHHTracker[K](hhPct: HeavyHittersPercent, updateFreq: WriteOpe
private[this] var nextRollOver: Long = System.currentTimeMillis + roFreq.toLong
private[this] final val updateOps = new java.util.concurrent.atomic.AtomicInteger(0)

private[this] final val hashes: IndexedSeq[CMSHash] = {
private[this] final val hashes: IndexedSeq[CMSHash[Long]] = {
val r = new scala.util.Random(5)
(0 until DEPTH).map { _ => CMSHash(r.nextInt, 0, WIDTH) }
(0 until DEPTH).map { _ => CMSHash[Long](r.nextInt, 0, WIDTH) }
}.toIndexedSeq

@inline
Expand Down

0 comments on commit 05d9803

Please sign in to comment.