Scala 2.13.0 rc2 (#26967)

This commit is contained in:
Arnout Engelen 2019-05-24 08:11:50 +02:00 committed by Patrik Nordwall
parent 24a3bba135
commit 814cfa286c
168 changed files with 396 additions and 315 deletions

View file

@ -8,7 +8,7 @@ import java.io.File
import java.nio.ByteBuffer
import java.util.concurrent.TimeUnit
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
import scala.concurrent.duration._
import scala.util.Try
import scala.util.control.NonFatal
@ -301,7 +301,7 @@ final class LmdbDurableStore(config: Config) extends Actor with ActorLogging {
TimeUnit.NANOSECONDS.toMillis(System.nanoTime - t0))
} catch {
case NonFatal(e) =>
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
log.error(e, "failed to store [{}]", pending.keySet.asScala.mkString(","))
tx.abort()
} finally {

View file

@ -43,7 +43,7 @@ final case class GSet[A] private (elements: Set[A])(override val delta: Option[G
* Java API
*/
def getElements(): java.util.Set[A] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
elements.asJava
}

View file

@ -75,7 +75,7 @@ final class LWWMap[A, B] private[akka] (private[akka] val underlying: ORMap[A, L
* Java API: All entries of the map.
*/
def getEntries(): java.util.Map[A, B] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
entries.asJava
}

View file

@ -196,7 +196,7 @@ final class ORMap[A, B <: ReplicatedData] private[akka] (
* Java API: All entries of the map.
*/
def getEntries(): java.util.Map[A, B] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
entries.asJava
}

View file

@ -102,7 +102,7 @@ final class ORMultiMap[A, B] private[akka] (
* Java API: All entries of a multimap where keys are strings and values are sets.
*/
def getEntries(): java.util.Map[A, java.util.Set[B]] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
val result = new java.util.HashMap[A, java.util.Set[B]]
if (withValueDeltas)
underlying.entries.foreach {
@ -165,14 +165,14 @@ final class ORMultiMap[A, B] private[akka] (
* replicated data set.
*/
def put(node: SelfUniqueAddress, key: A, value: java.util.Set[B]): ORMultiMap[A, B] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
put(node.uniqueAddress, key, value.asScala.toSet)
}
@Deprecated
@deprecated("Use `put` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
def put(node: Cluster, key: A, value: java.util.Set[B]): ORMultiMap[A, B] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
put(node.selfUniqueAddress, key, value.asScala.toSet)
}

View file

@ -309,7 +309,7 @@ final class ORSet[A] private[akka] (
* Java API
*/
def getElements(): java.util.Set[A] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
elements.asJava
}

View file

@ -54,7 +54,7 @@ final class PNCounterMap[A] private[akka] (private[akka] val underlying: ORMap[A
/** Java API */
def getEntries: java.util.Map[A, BigInteger] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
underlying.entries.map { case (k, c) => k -> c.value.bigInteger }.asJava
}

View file

@ -65,6 +65,8 @@ import akka.event.Logging
import akka.util.JavaDurationConverters._
import akka.util.ccompat._
import com.github.ghik.silencer.silent
@ccompatUsedUntil213
object ReplicatorSettings {
@ -87,7 +89,7 @@ object ReplicatorSettings {
case _ => config.getDuration("pruning-interval", MILLISECONDS).millis
}
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
new ReplicatorSettings(
role = roleOption(config.getString("role")),
gossipInterval = config.getDuration("gossip-interval", MILLISECONDS).millis,
@ -177,7 +179,7 @@ final class ReplicatorSettings(
deltaCrdtEnabled: Boolean,
maxDeltaSize: Int) =
this(
role.toSet,
role.iterator.toSet,
gossipInterval,
notifySubscribersInterval,
maxDeltaElements,
@ -201,7 +203,7 @@ final class ReplicatorSettings(
pruningInterval: FiniteDuration,
maxPruningDissemination: FiniteDuration) =
this(
roles = role.toSet,
roles = role.iterator.toSet,
gossipInterval,
notifySubscribersInterval,
maxDeltaElements,
@ -270,9 +272,9 @@ final class ReplicatorSettings(
deltaCrdtEnabled,
200)
def withRole(role: String): ReplicatorSettings = copy(roles = ReplicatorSettings.roleOption(role).toSet)
def withRole(role: String): ReplicatorSettings = copy(roles = ReplicatorSettings.roleOption(role).iterator.toSet)
def withRole(role: Option[String]): ReplicatorSettings = copy(roles = role.toSet)
def withRole(role: Option[String]): ReplicatorSettings = copy(roles = role.iterator.toSet)
@varargs
def withRoles(roles: String*): ReplicatorSettings = copy(roles = roles.toSet)
@ -325,7 +327,7 @@ final class ReplicatorSettings(
* Java API
*/
def withDurableKeys(durableKeys: java.util.Set[String]): ReplicatorSettings = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
withDurableKeys(durableKeys.asScala.toSet)
}
@ -464,7 +466,7 @@ object Replicator {
* Java API
*/
def getKeyIds: java.util.Set[String] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
keyIds.asJava
}
}
@ -1329,7 +1331,9 @@ final class Replicator(settings: ReplicatorSettings) extends Actor with ActorLog
// possibility to disable Gossip for testing purpose
var fullStateGossipEnabled = true
@silent
val subscribers = new mutable.HashMap[KeyId, mutable.Set[ActorRef]] with mutable.MultiMap[KeyId, ActorRef]
@silent
val newSubscribers = new mutable.HashMap[KeyId, mutable.Set[ActorRef]] with mutable.MultiMap[KeyId, ActorRef]
var subscriptionKeys = Map.empty[KeyId, KeyR]

View file

@ -11,7 +11,7 @@ import java.util.Comparator
import java.util.TreeSet
import scala.annotation.tailrec
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
import scala.collection.immutable
import akka.actor.ExtendedActorSystem

View file

@ -6,7 +6,7 @@ package akka.cluster.ddata.protobuf
import scala.concurrent.duration._
import java.util.concurrent.TimeUnit
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
import scala.collection.immutable
import scala.concurrent.duration.Duration
import akka.actor.ExtendedActorSystem

View file

@ -10,7 +10,7 @@ import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
import scala.annotation.tailrec
import scala.collection.immutable.TreeMap
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
import akka.actor.ActorRef
import akka.actor.Address
import akka.actor.ExtendedActorSystem

View file

@ -138,7 +138,7 @@ class ORMultiMapSpec extends WordSpec with Matchers {
"be able to get all bindings for an entry and then reduce them upon putting them back" in {
val m = ORMultiMap().addBinding(node1, "a", "A1").addBinding(node1, "a", "A2").addBinding(node1, "b", "B1")
val Some(a) = m.get("a")
val a = m.get("a").get
a should be(Set("A1", "A2"))