Skip to content

Commit 7046e90

Browse files
committed
Merge branch 'release/0.9.1'
2 parents 295bdbd + b0bb0b0 commit 7046e90

File tree

31 files changed

+1546
-34
lines changed

31 files changed

+1546
-34
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: scala
22
scala:
3-
- 2.10.3
3+
- 2.10.4
44
- 2.9.3
55
before_script:
66
- mysql -u root -e "create database storehaus_test;"

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Storehaus #
22

3+
### Version 0.9.1 ###
4+
* Feature/write through cache perf: https://github.com/twitter/storehaus/pull/234
5+
* Share the Retrying Read Write store in storehaus repo: https://github.com/twitter/storehaus/pull/230
6+
* initial Kafka 0.8 support: https://github.com/twitter/storehaus/pull/232
7+
* Exceptions on the cache-store should be ignored for Read/WriteThroughStore: https://github.com/twitter/storehaus/pull/225
8+
39
### Version 0.9.0 ###
410
* Reporting store algebra: https://github.com/twitter/storehaus/pull/176
511
* Bumping finagle to a more recent version, changes that were required: https://github.com/twitter/storehaus/pull/223

project/Build.scala

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import Keys._
2121
import spray.boilerplate.BoilerplatePlugin.Boilerplate
2222
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
2323
import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact
24+
import sbtassembly.Plugin._
25+
import AssemblyKeys._
26+
2427

2528
object StorehausBuild extends Build {
2629
def withCross(dep: ModuleID) =
@@ -35,7 +38,7 @@ object StorehausBuild extends Build {
3538
case version if version startsWith "2.10" => "org.specs2" %% "specs2" % "1.13" % "test"
3639
}
3740
val extraSettings =
38-
Project.defaultSettings ++ Boilerplate.settings ++ mimaDefaultSettings
41+
Project.defaultSettings ++ Boilerplate.settings ++ assemblySettings ++ mimaDefaultSettings
3942

4043
def ciSettings: Seq[Project.Setting[_]] =
4144
if (sys.env.getOrElse("TRAVIS", "false").toBoolean) Seq(
@@ -55,8 +58,8 @@ object StorehausBuild extends Build {
5558
val sharedSettings = extraSettings ++ ciSettings ++ Seq(
5659
organization := "com.twitter",
5760
scalaVersion := "2.9.3",
58-
version := "0.9.0",
59-
crossScalaVersions := Seq("2.9.3", "2.10.0"),
61+
version := "0.9.1",
62+
crossScalaVersions := Seq("2.9.3", "2.10.4"),
6063
javacOptions ++= Seq("-source", "1.6", "-target", "1.6"),
6164
javacOptions in doc := Seq("-source", "1.6"),
6265
libraryDependencies <+= scalaVersion(specs2Import(_)),
@@ -116,10 +119,10 @@ object StorehausBuild extends Build {
116119
.filterNot(unreleasedModules.contains(_))
117120
.map { s => "com.twitter" % ("storehaus-" + s + "_2.9.3") % "0.9.0" }
118121

119-
val algebirdVersion = "0.5.0"
120-
val bijectionVersion = "0.6.2"
122+
val algebirdVersion = "0.7.0"
123+
val bijectionVersion = "0.6.3"
121124
val utilVersion = "6.11.0"
122-
val scaldingVersion = "0.9.0rc15"
125+
val scaldingVersion = "0.11.1"
123126

124127
lazy val storehaus = Project(
125128
id = "storehaus",
@@ -139,6 +142,7 @@ object StorehausBuild extends Build {
139142
storehausHBase,
140143
storehausDynamoDB,
141144
storehausKafka,
145+
storehausKafka08,
142146
storehausMongoDB,
143147
storehausElastic,
144148
storehausTesting
@@ -225,7 +229,7 @@ object StorehausBuild extends Build {
225229
libraryDependencies ++= Seq (
226230
"com.twitter" %% "bijection-core" % bijectionVersion,
227231
"com.twitter" %% "bijection-avro" % bijectionVersion,
228-
"com.twitter"%"kafka_2.9.2"%"0.7.0" excludeAll(
232+
"com.twitter"%"kafka_2.9.2"%"0.7.0" % "provided" excludeAll(
229233
ExclusionRule("com.sun.jdmk","jmxtools"),
230234
ExclusionRule( "com.sun.jmx","jmxri"),
231235
ExclusionRule( "javax.jms","jms")
@@ -235,6 +239,19 @@ object StorehausBuild extends Build {
235239
parallelExecution in Test := false
236240
).dependsOn(storehausAlgebra % "test->test;compile->compile")
237241

242+
lazy val storehausKafka08 = module("kafka-08").settings(
243+
libraryDependencies ++= Seq (
244+
"com.twitter" %% "bijection-core" % bijectionVersion,
245+
"com.twitter" %% "bijection-avro" % bijectionVersion,
246+
"org.apache.kafka" % "kafka_2.9.2" % "0.8.0" % "provided" excludeAll(
247+
ExclusionRule(organization = "com.sun.jdmk"),
248+
ExclusionRule(organization = "com.sun.jmx"),
249+
ExclusionRule(organization = "javax.jms"))
250+
),
251+
// we don't want various tests clobbering each others keys
252+
parallelExecution in Test := false
253+
).dependsOn(storehausCore,storehausAlgebra % "test->test;compile->compile")
254+
238255
lazy val storehausMongoDB= module("mongodb").settings(
239256
libraryDependencies ++= Seq(
240257
"com.twitter" %% "bijection-core" % bijectionVersion,
@@ -265,4 +282,14 @@ object StorehausBuild extends Build {
265282
withCross("com.twitter" %% "util-core" % utilVersion))
266283
)
267284
)
285+
286+
lazy val storehausCaliper = module("caliper").settings(
287+
libraryDependencies ++= Seq("com.google.caliper" % "caliper" % "0.5-rc1",
288+
"com.google.code.java-allocation-instrumenter" % "java-allocation-instrumenter" % "2.0",
289+
"com.google.code.gson" % "gson" % "1.7.1",
290+
"com.twitter" %% "bijection-core" % bijectionVersion,
291+
"com.twitter" %% "algebird-core" % algebirdVersion),
292+
javaOptions in run <++= (fullClasspath in Runtime) map { cp => Seq("-cp", sbt.Build.data(cp).mkString(":")) }
293+
).dependsOn(storehausCore, storehausAlgebra, storehausCache)
294+
268295
}

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.1")
88
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.6")
99

1010
addSbtPlugin("io.spray" % "sbt-boilerplate" % "0.5.1")
11+
12+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2013 Twitter Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
5+
* not use this file except in compliance with the License. You may obtain
6+
* a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.twitter.storehaus.algebra
18+
19+
import com.twitter.storehaus.{Store, EagerWriteThroughCacheStore }
20+
import com.twitter.storehaus.cache.MutableCache
21+
import com.twitter.util.Future
22+
import com.twitter.storehaus.cache.{MutableCache, HeavyHittersPercent, WriteOperationUpdateFrequency, RollOverFrequencyMS, HHFilteredCache}
23+
24+
object HHFilteredStore {
25+
def buildStore[K, V](store: Store[K, V], cache: MutableCache[K, Future[Option[V]]], hhPct: HeavyHittersPercent,
26+
writeUpdateFreq: WriteOperationUpdateFrequency, rolloverFreq: RollOverFrequencyMS): Store[K, V] = {
27+
val filteredCacheStore = new HHFilteredCache(cache, hhPct, writeUpdateFreq, rolloverFreq)
28+
new EagerWriteThroughCacheStore[K, V](store, filteredCacheStore)
29+
}
30+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright 2013 Twitter Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
5+
* not use this file except in compliance with the License. You may obtain
6+
* a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.twitter.storehaus.cache
17+
18+
/** Defines the base of a proxy for a given type.
19+
* A instance of Proxied for type T is intended to use the `self`
20+
* member to forward all methods of an new instance of type T to.
21+
* This allows for extensions of type T which can inherit a proxied
22+
* instance's behavior without needing to override every method of type T.
23+
*
24+
* {{{
25+
*
26+
* class Dazzle {
27+
* def a: String = "default a"
28+
* def b: String = "default b"
29+
* // ...
30+
* }
31+
*
32+
* // define a reusable concrete proxy statisfying Dazzle forwarding
33+
* // all calls to Proxied method self
34+
* class DazzleProxy(val self: Dazzle) extends Dazzle with Proxied[Dazzle] {
35+
* def a: String = self.a
36+
* def b: String = self.b
37+
* }
38+
*
39+
* val bedazzlable = new Dazzle {
40+
* // return a new Dazzle with some sizzle
41+
* def be(sizzle: String): Dazzle = new DazzleProxy(this) {
42+
* override def b = "%s %s!!!" format(self.b, sizzle)
43+
* }
44+
* }
45+
*
46+
* val dazzled = bedazzlable.be("dazzled")
47+
* dazzled.b // default b dazzled!!!
48+
* dazzled.a // default a
49+
*
50+
* }}}
51+
*
52+
* @author Doug Tangren
53+
*/
54+
trait CacheProxied[T] {
55+
protected def self: T
56+
}

0 commit comments

Comments
 (0)