Skip to content

Commit

Permalink
Merge branch 'release/0.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ianoc committed Jul 11, 2014
2 parents 295bdbd + b0bb0b0 commit 7046e90
Show file tree
Hide file tree
Showing 31 changed files with 1,546 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: scala
scala:
- 2.10.3
- 2.10.4
- 2.9.3
before_script:
- mysql -u root -e "create database storehaus_test;"
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Storehaus #

### Version 0.9.1 ###
* Feature/write through cache perf: https://github.com/twitter/storehaus/pull/234
* Share the Retrying Read Write store in storehaus repo: https://github.com/twitter/storehaus/pull/230
* initial Kafka 0.8 support: https://github.com/twitter/storehaus/pull/232
* Exceptions on the cache-store should be ignored for Read/WriteThroughStore: https://github.com/twitter/storehaus/pull/225

### Version 0.9.0 ###
* Reporting store algebra: https://github.com/twitter/storehaus/pull/176
* Bumping finagle to a more recent version, changes that were required: https://github.com/twitter/storehaus/pull/223
Expand Down
41 changes: 34 additions & 7 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import Keys._
import spray.boilerplate.BoilerplatePlugin.Boilerplate
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact
import sbtassembly.Plugin._
import AssemblyKeys._


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

def ciSettings: Seq[Project.Setting[_]] =
if (sys.env.getOrElse("TRAVIS", "false").toBoolean) Seq(
Expand All @@ -55,8 +58,8 @@ object StorehausBuild extends Build {
val sharedSettings = extraSettings ++ ciSettings ++ Seq(
organization := "com.twitter",
scalaVersion := "2.9.3",
version := "0.9.0",
crossScalaVersions := Seq("2.9.3", "2.10.0"),
version := "0.9.1",
crossScalaVersions := Seq("2.9.3", "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 @@ -116,10 +119,10 @@ object StorehausBuild extends Build {
.filterNot(unreleasedModules.contains(_))
.map { s => "com.twitter" % ("storehaus-" + s + "_2.9.3") % "0.9.0" }

val algebirdVersion = "0.5.0"
val bijectionVersion = "0.6.2"
val algebirdVersion = "0.7.0"
val bijectionVersion = "0.6.3"
val utilVersion = "6.11.0"
val scaldingVersion = "0.9.0rc15"
val scaldingVersion = "0.11.1"

lazy val storehaus = Project(
id = "storehaus",
Expand All @@ -139,6 +142,7 @@ object StorehausBuild extends Build {
storehausHBase,
storehausDynamoDB,
storehausKafka,
storehausKafka08,
storehausMongoDB,
storehausElastic,
storehausTesting
Expand Down Expand Up @@ -225,7 +229,7 @@ object StorehausBuild extends Build {
libraryDependencies ++= Seq (
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "bijection-avro" % bijectionVersion,
"com.twitter"%"kafka_2.9.2"%"0.7.0" excludeAll(
"com.twitter"%"kafka_2.9.2"%"0.7.0" % "provided" excludeAll(
ExclusionRule("com.sun.jdmk","jmxtools"),
ExclusionRule( "com.sun.jmx","jmxri"),
ExclusionRule( "javax.jms","jms")
Expand All @@ -235,6 +239,19 @@ object StorehausBuild extends Build {
parallelExecution in Test := false
).dependsOn(storehausAlgebra % "test->test;compile->compile")

lazy val storehausKafka08 = module("kafka-08").settings(
libraryDependencies ++= Seq (
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "bijection-avro" % bijectionVersion,
"org.apache.kafka" % "kafka_2.9.2" % "0.8.0" % "provided" excludeAll(
ExclusionRule(organization = "com.sun.jdmk"),
ExclusionRule(organization = "com.sun.jmx"),
ExclusionRule(organization = "javax.jms"))
),
// we don't want various tests clobbering each others keys
parallelExecution in Test := false
).dependsOn(storehausCore,storehausAlgebra % "test->test;compile->compile")

lazy val storehausMongoDB= module("mongodb").settings(
libraryDependencies ++= Seq(
"com.twitter" %% "bijection-core" % bijectionVersion,
Expand Down Expand Up @@ -265,4 +282,14 @@ object StorehausBuild extends Build {
withCross("com.twitter" %% "util-core" % utilVersion))
)
)

lazy val storehausCaliper = module("caliper").settings(
libraryDependencies ++= Seq("com.google.caliper" % "caliper" % "0.5-rc1",
"com.google.code.java-allocation-instrumenter" % "java-allocation-instrumenter" % "2.0",
"com.google.code.gson" % "gson" % "1.7.1",
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "algebird-core" % algebirdVersion),
javaOptions in run <++= (fullClasspath in Runtime) map { cp => Seq("-cp", sbt.Build.data(cp).mkString(":")) }
).dependsOn(storehausCore, storehausAlgebra, storehausCache)

}
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.1")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.6")

addSbtPlugin("io.spray" % "sbt-boilerplate" % "0.5.1")

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2013 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.twitter.storehaus.algebra

import com.twitter.storehaus.{Store, EagerWriteThroughCacheStore }
import com.twitter.storehaus.cache.MutableCache
import com.twitter.util.Future
import com.twitter.storehaus.cache.{MutableCache, HeavyHittersPercent, WriteOperationUpdateFrequency, RollOverFrequencyMS, HHFilteredCache}

object HHFilteredStore {
def buildStore[K, V](store: Store[K, V], cache: MutableCache[K, Future[Option[V]]], hhPct: HeavyHittersPercent,
writeUpdateFreq: WriteOperationUpdateFrequency, rolloverFreq: RollOverFrequencyMS): Store[K, V] = {
val filteredCacheStore = new HHFilteredCache(cache, hhPct, writeUpdateFreq, rolloverFreq)
new EagerWriteThroughCacheStore[K, V](store, filteredCacheStore)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright 2013 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.twitter.storehaus.cache

/** Defines the base of a proxy for a given type.
* A instance of Proxied for type T is intended to use the `self`
* member to forward all methods of an new instance of type T to.
* This allows for extensions of type T which can inherit a proxied
* instance's behavior without needing to override every method of type T.
*
* {{{
*
* class Dazzle {
* def a: String = "default a"
* def b: String = "default b"
* // ...
* }
*
* // define a reusable concrete proxy statisfying Dazzle forwarding
* // all calls to Proxied method self
* class DazzleProxy(val self: Dazzle) extends Dazzle with Proxied[Dazzle] {
* def a: String = self.a
* def b: String = self.b
* }
*
* val bedazzlable = new Dazzle {
* // return a new Dazzle with some sizzle
* def be(sizzle: String): Dazzle = new DazzleProxy(this) {
* override def b = "%s %s!!!" format(self.b, sizzle)
* }
* }
*
* val dazzled = bedazzlable.be("dazzled")
* dazzled.b // default b dazzled!!!
* dazzled.a // default a
*
* }}}
*
* @author Doug Tangren
*/
trait CacheProxied[T] {
protected def self: T
}
Loading

0 comments on commit 7046e90

Please sign in to comment.