Skip to content

Commit

Permalink
Bump finagle version to 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ttim committed Feb 5, 2019
1 parent d6dee89 commit 94bcda0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 33 deletions.
14 changes: 9 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ val sharedSettings = extraSettings ++ ciSettings ++ Seq(
"Conjars Repository" at "http://conjars.org/repo",
// this repo is needed to retrieve the excluded dependencies from storehaus-memcache
// during mima checks
"Twitter Maven" at "http://maven.twttr.com"
"Twitter Maven" at "https://maven.twttr.com"
),
parallelExecution in Test := true,
scalacOptions ++= Seq(
Expand Down Expand Up @@ -133,10 +133,10 @@ lazy val noPublishSettings = Seq(

val algebirdVersion = "0.13.0"
val bijectionVersion = "0.9.5"
val utilVersion = "6.43.0"
val utilVersion = "7.0.0"

val scaldingVersion = "0.17.0"
val finagleVersion = "6.43.0"
val finagleVersion = "7.0.0"
val scalatestVersion = "3.0.1"
val scalaCheckVersion = "1.13.4"

Expand Down Expand Up @@ -206,14 +206,18 @@ lazy val storehausMemcache = module("memcache").settings(
).dependsOn(storehausAlgebra % "test->test;compile->compile")

lazy val storehausMySQL = module("mysql").settings(
libraryDependencies += "com.twitter" %% "finagle-mysql" % finagleVersion
libraryDependencies ++= Seq(
"com.twitter" %% "finagle-mysql" % finagleVersion,
"com.twitter" %% "finagle-netty3" % finagleVersion
)
).dependsOn(storehausAlgebra % "test->test;compile->compile")

lazy val storehausRedis = module("redis").settings(
libraryDependencies ++= Seq (
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "bijection-netty" % bijectionVersion,
"com.twitter" %% "finagle-redis" % finagleVersion
"com.twitter" %% "finagle-redis" % finagleVersion,
"com.twitter" %% "finagle-netty3" % finagleVersion
),
// we don't want various tests clobbering each others keys
parallelExecution in Test := false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import com.twitter.algebird.Semigroup
import com.twitter.bijection.{Codec, Injection}
import com.twitter.bijection.netty.Implicits._
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.memcached.KetamaClientBuilder
import com.twitter.finagle.memcached.protocol.text.Memcached
import com.twitter.finagle.netty3.{BufChannelBuffer, ChannelBufferBuf}
import com.twitter.util.{Duration, Future, Time}
import com.twitter.finagle.memcached.Client
Expand Down Expand Up @@ -58,29 +56,6 @@ object MemcacheStore {
client: Client, ttl: Duration = DEFAULT_TTL, flag: Int = DEFAULT_FLAG): MemcacheStore =
new MemcacheStore(client, ttl, flag)

def defaultClient(
name: String,
nodeString: String,
retries: Int = DEFAULT_RETRIES,
timeout: Duration = DEFAULT_TIMEOUT,
hostConnectionLimit: Int = DEFAULT_CONNECTION_LIMIT): Client = {
val builder = ClientBuilder()
.name(name)
.retries(retries)
.tcpConnectTimeout(timeout)
.requestTimeout(timeout)
.connectTimeout(timeout)
.hostConnectionLimit(hostConnectionLimit)
.codec(Memcached())

val liveness = builder.params[Transport.Liveness].copy(readTimeout = timeout)
val liveBuilder = builder.configured(liveness)

KetamaClientBuilder()
.clientBuilder(liveBuilder)
.nodes(nodeString)
.build()
}

/**
* Returns a Memcache-backed Store[K, V] that uses
Expand Down Expand Up @@ -150,5 +125,5 @@ class MemcacheStore(val client: Client, val ttl: Duration, val flag: Int)
case (key, None) => client.delete(key).unit
}

override def close(t: Time): Future[Unit] = Future(client.release())
override def close(t: Time): Future[Unit] = Future(client.close())
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package com.twitter.storehaus.memcache
import com.twitter.algebird.Semigroup
import com.twitter.bijection.Injection
import com.twitter.bijection.netty.ChannelBufferBijection
import com.twitter.finagle.memcached.Client
import com.twitter.finagle.Memcached
import com.twitter.storehaus.testing.SelfAggregatingCloseableCleanup
import com.twitter.storehaus.testing.generator.NonEmpty
import com.twitter.util.{Future, Await}
Expand Down Expand Up @@ -87,7 +87,7 @@ object MergeableMemcacheStoreProperties extends Properties("MergeableMemcacheSto

property("MergeableMemcacheStore put, get and merge") = {
implicit val cb2ary = ChannelBufferBijection
val client = Client("localhost:11211")
val client = Memcached.client.newRichClient("localhost:11211")
val injection = Injection.connect[Long, String, Array[Byte], ChannelBuffer]
val semigroup = implicitly[Semigroup[Long]]
val store = MergeableMemcacheStore[String, Long](client)(identity)(injection, semigroup)
Expand Down

0 comments on commit 94bcda0

Please sign in to comment.