From 13c19ac80158361e97af8dec750d2056eae58e0f Mon Sep 17 00:00:00 2001 From: Debasish Ghosh Date: Sat, 15 Sep 2018 20:12:31 +0530 Subject: [PATCH] Changes to fix deprecations for Scala 2.13-M4 --- build.sbt | 2 +- src/main/scala/com/redis/IO.scala | 2 +- src/main/scala/com/redis/cluster/HashRing.scala | 2 +- src/main/scala/com/redis/cluster/RedisCluster.scala | 2 +- src/main/scala/com/redis/cluster/RedisShards.scala | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index 0810ee0e..db6baee2 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ lazy val redisClient = (project in file(".")).settings(coreSettings : _*) lazy val commonSettings: Seq[Setting[_]] = Seq( organization := "net.debasishg", - version := "3.7", + version := "3.8", scalaVersion := "2.12.6", crossScalaVersions := Seq("2.12.6", "2.11.12", "2.10.7", "2.13.0-M4"), diff --git a/src/main/scala/com/redis/IO.scala b/src/main/scala/com/redis/IO.scala index c4e1da80..c63e2c09 100644 --- a/src/main/scala/com/redis/IO.scala +++ b/src/main/scala/com/redis/IO.scala @@ -93,7 +93,7 @@ trait IO extends Log { } else { if (found != Nil) { delimiter = crlf - build ++= found.reverseMap(_.toByte) + build ++= found.reverseIterator.map(_.toByte).toList found = Nil } build += next.toByte diff --git a/src/main/scala/com/redis/cluster/HashRing.scala b/src/main/scala/com/redis/cluster/HashRing.scala index 36ca7e4b..a2e7dcad 100644 --- a/src/main/scala/com/redis/cluster/HashRing.scala +++ b/src/main/scala/com/redis/cluster/HashRing.scala @@ -76,7 +76,7 @@ case class HashRing[T](nodes: List[T], replicas: Int) { def isEmpty: Boolean = ring.isEmpty private def nodeHashFor(node: T, replica: Int): Long = { - calculateChecksum((node + ":" + replica).getBytes("UTF-8")) + calculateChecksum((node + ":" + replica).getBytes("UTF-8").toIndexedSeq) } } diff --git a/src/main/scala/com/redis/cluster/RedisCluster.scala b/src/main/scala/com/redis/cluster/RedisCluster.scala index 6d9233f2..b4840083 100644 --- a/src/main/scala/com/redis/cluster/RedisCluster.scala +++ b/src/main/scala/com/redis/cluster/RedisCluster.scala @@ -81,7 +81,7 @@ abstract class RedisCluster(hosts: ClusterNode*) extends RedisCommand { // get node for the key def nodeForKey(key: Any)(implicit format: Format): IdentifiableRedisClientPool = { val bKey = format(key) - hr.getNode(keyTag.flatMap(_.tag(bKey)).getOrElse(bKey)) + hr.getNode(keyTag.flatMap(_.tag(bKey.toIndexedSeq)).getOrElse(bKey.toIndexedSeq)) } def processForKey[T](key: Any)(body: RedisCommand => T)(implicit format: Format): T = { diff --git a/src/main/scala/com/redis/cluster/RedisShards.scala b/src/main/scala/com/redis/cluster/RedisShards.scala index c7c9c8fa..02ee1ae4 100644 --- a/src/main/scala/com/redis/cluster/RedisShards.scala +++ b/src/main/scala/com/redis/cluster/RedisShards.scala @@ -25,7 +25,7 @@ abstract class RedisShards(val hosts: List[ClusterNode]) extends RedisCommand { // get node for the key def nodeForKey(key: Any)(implicit format: Format): RedisClientPool = { val bKey = format(key) - val selectedNode = hr.getNode(keyTag.flatMap(_.tag(bKey)).getOrElse(bKey)) + val selectedNode = hr.getNode(keyTag.flatMap(_.tag(bKey.toIndexedSeq)).getOrElse(bKey.toIndexedSeq)) clients(selectedNode) }