upgraded redisclient to version 1.2: includes api name changes for conformance with redis server (earlier ones deprecated). Also an implementation of Deque that can be used for Durable Q in actors
This commit is contained in:
parent
594ba80052
commit
5566b21b5e
7 changed files with 19 additions and 19 deletions
|
|
@ -261,7 +261,7 @@ private [akka] object RedisStorageBackend extends
|
|||
}
|
||||
|
||||
override def incrementByAtomically(name: String, by: Int): Option[Int] = withErrorHandling {
|
||||
db.incrBy(new String(encode(name.getBytes)), by) match {
|
||||
db.incrby(new String(encode(name.getBytes)), by) match {
|
||||
case Some(i) => Some(i)
|
||||
case None =>
|
||||
throw new IllegalArgumentException(name + " exception in incrby")
|
||||
|
|
@ -277,7 +277,7 @@ private [akka] object RedisStorageBackend extends
|
|||
}
|
||||
|
||||
override def decrementByAtomically(name: String, by: Int): Option[Int] = withErrorHandling {
|
||||
db.decrBy(new String(encode(name.getBytes)), by) match {
|
||||
db.decrby(new String(encode(name.getBytes)), by) match {
|
||||
case Some(i) => Some(i)
|
||||
case None =>
|
||||
throw new IllegalArgumentException(name + " exception in decrby")
|
||||
|
|
@ -390,7 +390,7 @@ private [akka] object RedisStorageBackend extends
|
|||
}
|
||||
}
|
||||
|
||||
def flushDB = withErrorHandling(db.flushDb)
|
||||
def flushDB = withErrorHandling(db.flushdb)
|
||||
|
||||
private def withErrorHandling[T](body: => T): T = {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class RedisPersistentActorSpec extends TestCase {
|
|||
bactor !! Debit("a-123", 8000, failer)
|
||||
assertEquals(BigInt(1000), (bactor !! Balance("a-123")).get)
|
||||
|
||||
val c: Integer = (bactor !! LogSize).get
|
||||
val c: Int = (bactor !! LogSize).get
|
||||
assertTrue(7 == c)
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ class RedisPersistentActorSpec extends TestCase {
|
|||
assertEquals(BigInt(5000), (bactor !! Balance("a-123")).get)
|
||||
|
||||
// should not count the failed one
|
||||
val c: Integer = (bactor !! LogSize).get
|
||||
val c: Int = (bactor !! LogSize).get
|
||||
assertTrue(3 == c)
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ class RedisPersistentActorSpec extends TestCase {
|
|||
assertEquals(BigInt(5000), (bactor !! (Balance("a-123"), 5000)).get)
|
||||
|
||||
// should not count the failed one
|
||||
val c: Integer = (bactor !! LogSize).get
|
||||
val c: Int = (bactor !! LogSize).get
|
||||
assertTrue(3 == c)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class RedisPersistentQSpec extends TestCase {
|
|||
qa !! NQ("a-123")
|
||||
qa !! NQ("a-124")
|
||||
qa !! NQ("a-125")
|
||||
val t: Integer = (qa !! SZ).get
|
||||
val t: Int = (qa !! SZ).get
|
||||
assertTrue(3 == t)
|
||||
}
|
||||
|
||||
|
|
@ -69,12 +69,12 @@ class RedisPersistentQSpec extends TestCase {
|
|||
qa !! NQ("a-123")
|
||||
qa !! NQ("a-124")
|
||||
qa !! NQ("a-125")
|
||||
val s: Integer = (qa !! SZ).get
|
||||
val s: Int = (qa !! SZ).get
|
||||
assertTrue(3 == s)
|
||||
assertEquals("a-123", (qa !! DQ).get)
|
||||
assertEquals("a-124", (qa !! DQ).get)
|
||||
assertEquals("a-125", (qa !! DQ).get)
|
||||
val t: Integer = (qa !! SZ).get
|
||||
val t: Int = (qa !! SZ).get
|
||||
assertTrue(0 == t)
|
||||
}
|
||||
|
||||
|
|
@ -88,13 +88,13 @@ class RedisPersistentQSpec extends TestCase {
|
|||
qa !! NQ("a-123")
|
||||
qa !! NQ("a-124")
|
||||
qa !! NQ("a-125")
|
||||
val t: Integer = (qa !! SZ).get
|
||||
val t: Int = (qa !! SZ).get
|
||||
assertTrue(3 == t)
|
||||
assertEquals("a-123", (qa !! DQ).get)
|
||||
val s: Integer = (qa !! SZ).get
|
||||
val s: Int = (qa !! SZ).get
|
||||
assertTrue(2 == s)
|
||||
qa !! MNDQ(List("a-126", "a-127"), 2, failer)
|
||||
val u: Integer = (qa !! SZ).get
|
||||
val u: Int = (qa !! SZ).get
|
||||
assertTrue(2 == u)
|
||||
}
|
||||
|
||||
|
|
@ -110,25 +110,25 @@ class RedisPersistentQSpec extends TestCase {
|
|||
qa !! NQ("a-124")
|
||||
qa !! NQ("a-125")
|
||||
|
||||
val t: Integer = (qa !! SZ).get
|
||||
val t: Int = (qa !! SZ).get
|
||||
assertTrue(3 == t)
|
||||
|
||||
// dequeue 1
|
||||
assertEquals("a-123", (qa !! DQ).get)
|
||||
|
||||
// size == 2
|
||||
val s: Integer = (qa !! SZ).get
|
||||
val s: Int = (qa !! SZ).get
|
||||
assertTrue(2 == s)
|
||||
|
||||
// enqueue 2, dequeue 2 => size == 2
|
||||
qa !! MNDQ(List("a-126", "a-127"), 2, failer)
|
||||
val u: Integer = (qa !! SZ).get
|
||||
val u: Int = (qa !! SZ).get
|
||||
assertTrue(2 == u)
|
||||
|
||||
// enqueue 2 => size == 4
|
||||
qa !! NQ("a-128")
|
||||
qa !! NQ("a-129")
|
||||
val v: Integer = (qa !! SZ).get
|
||||
val v: Int = (qa !! SZ).get
|
||||
assertTrue(4 == v)
|
||||
|
||||
// enqueue 1 => size 5
|
||||
|
|
@ -138,7 +138,7 @@ class RedisPersistentQSpec extends TestCase {
|
|||
qa !! MNDQ(List("a-130"), 6, failer)
|
||||
} catch { case e: Exception => {} }
|
||||
|
||||
val w: Integer = (qa !! SZ).get
|
||||
val w: Int = (qa !! SZ).get
|
||||
assertTrue(4 == w)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -3,6 +3,6 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.redis</groupId>
|
||||
<artifactId>redisclient</artifactId>
|
||||
<version>2.8.0.Beta1-1.2-SNAPSHOT</version>
|
||||
<version>2.8.0.Beta1-1.2</version>
|
||||
<packaging>jar</packaging>
|
||||
</project>
|
||||
|
|
@ -328,7 +328,7 @@ class AkkaParent(info: ProjectInfo) extends AkkaDefaults(info) {
|
|||
}
|
||||
|
||||
class AkkaRedisProject(info: ProjectInfo) extends AkkaDefaults(info) {
|
||||
val redis = "com.redis" % "redisclient" % "2.8.0.Beta1-1.2-SNAPSHOT" % "compile"
|
||||
val redis = "com.redis" % "redisclient" % "2.8.0.Beta1-1.2" % "compile"
|
||||
override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
|
||||
lazy val dist = deployTask(info, distPath) dependsOn(`package`, packageDocs, packageSrc) describedAs("Deploying")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue