Use newer memcachedx

This commit is contained in:
Andrew Kuhnhausen 2015-01-29 15:41:13 -08:00
parent 626360040b
commit 5b41336080
3 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import com.lookout.borderpatrol.Session
import com.lookout.borderpatrol.session.id._
import com.lookout.borderpatrol.session._
import com.twitter.bijection.{Base64String, Injection}
import com.twitter.finagle.Memcached
import com.twitter.finagle.Memcachedx
import com.twitter.io.Charsets
import com.twitter.util.{Future, Duration, Await}
import org.jboss.netty.buffer.{ChannelBuffer, ChannelBuffers}
@ -92,7 +92,7 @@ case class InMemoryEncryptedSessionStore(implicit marshaller: Marshaller) extend
}
case class MemcachedSessionStore(dest: String, timeout: Duration)(implicit marshaller: Marshaller) extends SessionStoreApi {
val store = Memcached.newRichClient(dest).withStrings
val store = Memcachedx.newKetamaClient(dest).withStrings
def get(s: String): Option[Session] = {
for {

View File

@ -6,7 +6,7 @@ import com.lookout.borderpatrol.Session
import com.lookout.borderpatrol.session.id.{Marshaller, Generator => IdGenerator}
import com.lookout.borderpatrol.session.secret.InMemorySecretStore
import com.lookout.borderpatrol.session.store.{MemcachedSessionStore, InMemoryEncryptedSessionStore}
import com.twitter.finagle.memcached
import com.twitter.finagle.memcachedx
import com.twitter.io.Charsets
import com.twitter.util.{Duration, Future}
import org.jboss.netty.buffer.{ChannelBuffers, ChannelBuffer}
@ -55,13 +55,13 @@ class SessionStoreSpec extends FlatSpec with Matchers with MockFactory {
def toCb(s: String): ChannelBuffer =
ChannelBuffers.copiedBuffer(s.getBytes(Charsets.Utf8))
class MemcachedMockSessionStore(client: memcached.BaseClient[String]) extends MemcachedSessionStore(dest = "", timeout = Duration(1, TimeUnit.SECONDS)) {
class MemcachedMockSessionStore(client: memcachedx.BaseClient[String]) extends MemcachedSessionStore(dest = "", timeout = Duration(1, TimeUnit.SECONDS)) {
override val store = client
}
it should "store and retrieve sessions" in {
val s = mockSession
val memcachedClient = mock[memcached.BaseClient[String]]
val memcachedClient = mock[memcachedx.BaseClient[String]]
val flag = 0 // meaningless part of the protocol

View File

@ -11,7 +11,7 @@ object BorderPatrol extends Build {
scalaVersion := "2.11.5",
libraryDependencies ++= Seq(
"com.twitter" %% "twitter-server" % twitter_server,
"com.twitter" %% "finagle-memcached" % "6.24.0",
"com.twitter" %% "finagle-memcachedx" % "6.24.0",
"com.twitter" %% "bijection-core" % "0.7.0",
"io.argonaut" %% "argonaut" % "6.1-M5",
"org.scalatest" %% "scalatest" % "2.2.2" % "test",