Skip to content

Commit

Permalink
Merge branch 'sh_develop' into bump_finagle_save_txns
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Schobel committed Dec 10, 2014
2 parents 20b8555 + dae8611 commit 463cde4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: scala
scala:
- 2.10.4
- 2.9.3
before_script:
- mysql -u root -e "create database storehaus_test;"
- mysql -u root -e "create user 'storehaususer'@'localhost' identified by 'test1234';"
Expand Down
8 changes: 4 additions & 4 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ object StorehausBuild extends Build {

val sharedSettings = extraSettings ++ ciSettings ++ Seq(
organization := "com.twitter",
scalaVersion := "2.9.3",
scalaVersion := "2.10.4",
version := "0.9.1",
crossScalaVersions := Seq("2.9.3", "2.10.4"),
crossScalaVersions := Seq("2.10.4"),
javacOptions ++= Seq("-source", "1.6", "-target", "1.6"),
javacOptions in doc := Seq("-source", "1.6"),
libraryDependencies <+= scalaVersion(specs2Import(_)),
Expand Down Expand Up @@ -117,14 +117,14 @@ object StorehausBuild extends Build {
def youngestForwardCompatible(subProj: String) =
Some(subProj)
.filterNot(unreleasedModules.contains(_))
.map { s => "com.twitter" % ("storehaus-" + s + "_2.9.3") % "0.9.0" }
.map { s => "com.twitter" % ("storehaus-" + s + "_2.10") % "0.10.0" }

val algebirdVersion = "0.7.0"
val bijectionVersion = "0.6.3"
val utilVersion = "6.22.0"
val scaldingVersion = "0.11.1"

lazy val storehaus = Project(

id = "storehaus",
base = file("."),
settings = sharedSettings ++ DocGen.publishSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,17 @@ class ReadThroughStore[K, V](backingStore: ReadableStore[K, V], cache: Store[K,
val hits = responses.filter { !_._2.isEmpty }
val missedKeys = responses.filter { _._2.isEmpty }.keySet

FutureOps.mapCollect(backingStore.multiGet(missedKeys ++ failedKeys)).flatMap { storeResult =>
// write fetched keys to cache, best effort
mutex.acquire.flatMap { p =>
FutureOps.mapCollect(cache.multiPut(storeResult))(FutureCollector.bestEffort[(K1, Unit)])
.map { u => hits ++ storeResult }
.ensure { p.release }
val remaining = missedKeys ++ failedKeys
if (remaining.isEmpty) {
Future.value(hits) // no cache misses
} else {
FutureOps.mapCollect(backingStore.multiGet(remaining)).flatMap { storeResult =>
// write fetched keys to cache, best effort
mutex.acquire.flatMap { p =>
FutureOps.mapCollect(cache.multiPut(storeResult))(FutureCollector.bestEffort[(K1, Unit)])
.map { u => hits ++ storeResult }
.ensure { p.release }
}
}
}
}
Expand Down

0 comments on commit 463cde4

Please sign in to comment.