chore: Remove ccompat.JavaConverters (#2234)
This commit is contained in:
parent
9b2853c730
commit
8254acc0e8
184 changed files with 237 additions and 278 deletions
|
|
@ -18,8 +18,7 @@ import java.util.Optional
|
|||
import org.slf4j.Marker
|
||||
import org.slf4j.event.Level
|
||||
|
||||
import org.apache.pekko
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
import scala.jdk.OptionConverters._
|
||||
|
||||
object LoggingEvent {
|
||||
|
|
@ -81,7 +80,7 @@ final case class LoggingEvent(
|
|||
* Java API
|
||||
*/
|
||||
def getMdc: java.util.Map[String, String] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
mdc.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import pekko.actor.typed.{ ActorRef, Behavior, BehaviorInterceptor, PostStop, Si
|
|||
import pekko.actor.typed.receptionist.Receptionist
|
||||
import pekko.actor.typed.scaladsl.Behaviors
|
||||
import pekko.annotation.InternalApi
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ import pekko.annotation.InternalApi
|
|||
* Also clears the buffer..
|
||||
*/
|
||||
def flush(): Unit = synchronized {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
val logbackLogger = getLogbackLogger(classOf[CapturingAppender].getName + "Delegate")
|
||||
val appenders = logbackLogger.iteratorForAppenders().asScala.filterNot(_ == this).toList
|
||||
for (event <- buffer; appender <- appenders) {
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ import pekko.testkit.TestKit
|
|||
copy(mdc = newMdc)
|
||||
|
||||
override def withMdc(newMdc: java.util.Map[String, String]): javadsl.LoggingTestKit = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
withMdc(newMdc.asScala.toMap)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ private[pekko] final class FunctionRef[-T](override val path: ActorPath, send: (
|
|||
* this method.
|
||||
*/
|
||||
def logEntries: List[CapturedLogEvent] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
substituteLoggerFactory.getEventQueue
|
||||
.iterator()
|
||||
.asScala
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ import java.util.Collections
|
|||
|
||||
// invocations are synchronized via doAppend in AppenderBase
|
||||
override def append(event: ILoggingEvent): Unit = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
val throwable = event.getThrowableProxy match {
|
||||
case p: ThrowableProxy =>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ import pekko.japi.function.Creator
|
|||
import pekko.util.BoxedType
|
||||
import scala.jdk.DurationConverters._
|
||||
import pekko.util.PrettyDuration._
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
@InternalApi
|
||||
private[pekko] object TestProbeImpl {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import org.apache.pekko
|
|||
import pekko.actor.testkit.typed.internal.TestInboxImpl
|
||||
import pekko.actor.typed.ActorRef
|
||||
import pekko.annotation.DoNotInherit
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
object TestInbox {
|
||||
import pekko.actor.testkit.typed.scaladsl.TestInbox.address
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class ActorSelectionSpec extends PekkoSpec with DefaultTimeout {
|
|||
identify(system.child("c2").child("c21")) should ===(Some(c21)) // test Java API
|
||||
identify(system / Seq("c2", "c21")) should ===(Some(c21))
|
||||
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
identify(system.descendant(Seq("c2", "c21").asJava)) // test Java API
|
||||
}
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ class ActorSelectionSpec extends PekkoSpec with DefaultTimeout {
|
|||
}
|
||||
|
||||
"return deadLetters or ActorIdentity(None), respectively, for non-existing paths" in {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
def checkOne(looker: ActorRef, query: Query, result: Option[ActorRef]): Unit = {
|
||||
val lookup = askNode(looker, query)
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class ExtensionSpec extends AnyWordSpec with Matchers {
|
|||
}
|
||||
|
||||
"allow for auto-loading of library-extensions from reference.conf" in {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
// could be initialized by other tests, but assuming tests are not running in parallel
|
||||
val countBefore = InstanceCountingExtension.createCount.get()
|
||||
val system = ActorSystem("extensions")
|
||||
|
|
@ -133,7 +133,7 @@ class ExtensionSpec extends AnyWordSpec with Matchers {
|
|||
}
|
||||
|
||||
"not create duplicate instances when auto-loading of library-extensions" in {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
// could be initialized by other tests, but assuming tests are not running in parallel
|
||||
val countBefore = InstanceCountingExtension.createCount.get()
|
||||
val system = ActorSystem(
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ class FSMActorSpec extends PekkoSpec(Map("pekko.actor.debug.fsm" -> true)) with
|
|||
}
|
||||
|
||||
"log events and transitions if asked to do so" in {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
val config = ConfigFactory
|
||||
.parseMap(Map("pekko.loglevel" -> "DEBUG", "pekko.actor.debug.fsm" -> true).asJava)
|
||||
.withFallback(system.settings.config)
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ abstract class ActorModelSpec(config: String) extends PekkoSpec(config) with Def
|
|||
val f6 = a ? Reply("bar2")
|
||||
|
||||
val c = system.scheduler.scheduleOnce(2.seconds) {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
Thread.getAllStackTraces().asScala.foreach {
|
||||
case (thread, stack) =>
|
||||
println(s"$thread:")
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class DispatchersSpec extends PekkoSpec(DispatchersSpec.config) with ImplicitSen
|
|||
val defaultDispatcherConfig = settings.config.getConfig("pekko.actor.default-dispatcher")
|
||||
|
||||
lazy val allDispatchers: Map[String, MessageDispatcher] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
validTypes
|
||||
.map(t => (t, from(ConfigFactory.parseMap(Map(tipe -> t, id -> t).asJava).withFallback(defaultDispatcherConfig))))
|
||||
|
|
@ -175,7 +175,7 @@ class DispatchersSpec extends PekkoSpec(DispatchersSpec.config) with ImplicitSen
|
|||
}
|
||||
|
||||
"throw ConfigurationException if type does not exist" in {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
intercept[ConfigurationException] {
|
||||
from(
|
||||
ConfigFactory
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.scalatest.wordspec.AnyWordSpec
|
|||
import org.apache.pekko
|
||||
import pekko.actor._
|
||||
import pekko.testkit._
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
object LoggingReceiveSpec {
|
||||
class TestLogActor extends Actor {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.scalatest.concurrent.Eventually
|
|||
|
||||
import org.apache.pekko
|
||||
import pekko.testkit.PekkoSpec
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
abstract class DockerBindDnsService(config: Config) extends PekkoSpec(config) with Eventually {
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import org.scalatest.wordspec.AnyWordSpec
|
|||
import org.apache.pekko
|
||||
import pekko.testkit.TimingTest
|
||||
import pekko.util.DefaultExecutionContext._
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
class BoundedBlockingQueueSpec
|
||||
extends AnyWordSpec
|
||||
|
|
|
|||
|
|
@ -1020,7 +1020,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers {
|
|||
a.asByteBuffers.forall(_.isReadOnly)
|
||||
}
|
||||
check { (a: ByteString) =>
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
a.asByteBuffers.zip(a.getByteBuffers().asScala).forall(x => x._1 == x._2)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import org.apache.pekko
|
|||
import pekko.actor.typed.internal.PropsImpl._
|
||||
import pekko.annotation.DoNotInherit
|
||||
import pekko.annotation.InternalApi
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
object Props {
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import org.apache.pekko
|
|||
import pekko.actor.typed.{ ActorSystem, Extension, ExtensionId, Extensions }
|
||||
import pekko.actor.typed.ExtensionSetup
|
||||
import pekko.annotation.InternalApi
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import pekko.actor.typed.ActorRef
|
|||
import pekko.actor.typed.receptionist.{ Receptionist, ServiceKey }
|
||||
import pekko.actor.typed.receptionist.Receptionist.Command
|
||||
import pekko.annotation.InternalApi
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Internal API
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import pekko.actor.typed._
|
|||
import pekko.actor.typed.internal.{ BehaviorImpl, StashBufferImpl, TimerSchedulerImpl, WithMdcBehaviorInterceptor }
|
||||
import pekko.japi.function.{ Effect, Function2 => JapiFunction2 }
|
||||
import pekko.japi.pf.PFBuilder
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
import pekko.util.unused
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import org.apache.pekko
|
|||
import pekko.actor.typed.{ ActorRef, ActorSystem, Extension, ExtensionId, ExtensionSetup }
|
||||
import pekko.actor.typed.internal.receptionist._
|
||||
import pekko.annotation.DoNotInherit
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Register and discover actors that implement a service with a protocol defined by a [[ServiceKey]].
|
||||
|
|
|
|||
|
|
@ -21,3 +21,6 @@ ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.compat.PartialFunc
|
|||
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.ccompat.ccompatUsedUntil213")
|
||||
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.compat.Future")
|
||||
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.compat.Future$")
|
||||
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.ccompat.package")
|
||||
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.ccompat.package$")
|
||||
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.ccompat.package$JavaConverters$")
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import scala.collection.immutable
|
|||
import scala.annotation.nowarn
|
||||
|
||||
import org.apache.pekko
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Java API
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import pekko.util._
|
|||
import scala.jdk.FutureConverters._
|
||||
import scala.jdk.OptionConverters._
|
||||
import pekko.util.Helpers.toRootLowerCase
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
object BootstrapSetup {
|
||||
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ object CoordinatedShutdown extends ExtensionId[CoordinatedShutdown] with Extensi
|
|||
* INTERNAL API
|
||||
*/
|
||||
private[pekko] def phasesFromConfig(conf: Config): Map[String, Phase] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
val defaultPhaseTimeout = conf.getString("default-phase-timeout")
|
||||
val phasesConf = conf.getConfig("phases")
|
||||
val defaultPhaseConfig = ConfigFactory.parseString(s"""
|
||||
|
|
@ -512,7 +512,7 @@ final class CoordinatedShutdown private[pekko] (
|
|||
def get(phaseName: String): Option[PhaseDefinition] = Option(registeredPhases.get(phaseName))
|
||||
|
||||
def totalDuration(): FiniteDuration = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
registeredPhases.keySet.asScala.foldLeft(Duration.Zero) {
|
||||
case (acc, phase) =>
|
||||
acc + timeout(phase)
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ case object NoScopeGiven extends NoScopeGiven {
|
|||
*/
|
||||
private[pekko] class Deployer(val settings: ActorSystem.Settings, val dynamicAccess: DynamicAccess) {
|
||||
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
private val resizerEnabled: Config = ConfigFactory.parseString("resizer.enabled=on")
|
||||
private val deployments = new AtomicReference(WildcardIndex[Deploy]())
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ private[pekko] trait Children { this: ActorCell =>
|
|||
|
||||
final def children: immutable.Iterable[ActorRef] = childrenRefs.children
|
||||
final def getChildren(): java.lang.Iterable[ActorRef] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
children.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ class Dispatchers @InternalApi private[pekko] (
|
|||
* INTERNAL API
|
||||
*/
|
||||
private[pekko] def config(id: String, appConfig: Config): Config = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
def simpleName = id.substring(id.lastIndexOf('.') + 1)
|
||||
idConfig(id)
|
||||
.withFallback(appConfig)
|
||||
|
|
@ -230,7 +230,7 @@ class Dispatchers @InternalApi private[pekko] (
|
|||
}
|
||||
|
||||
private def idConfig(id: String): Config = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
ConfigFactory.parseMap(Map("id" -> id).asJava)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ private[pekko] class Mailboxes(
|
|||
private val mailboxTypeConfigurators = new ConcurrentHashMap[String, MailboxType]
|
||||
|
||||
private val mailboxBindings: Map[Class[_ <: Any], String] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
settings.config
|
||||
.getConfig("pekko.actor.mailbox.requirements")
|
||||
.root
|
||||
|
|
@ -285,7 +285,7 @@ private[pekko] class Mailboxes(
|
|||
|
||||
// INTERNAL API
|
||||
private def config(id: String): Config = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
ConfigFactory
|
||||
.parseMap(Map("id" -> id).asJava)
|
||||
.withFallback(settings.config.getConfig(id))
|
||||
|
|
|
|||
|
|
@ -777,7 +777,7 @@ object Logging {
|
|||
* Java API: Retrieve the contents of the MDC.
|
||||
*/
|
||||
def getMDC: java.util.Map[String, Any] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
mdc.asJava
|
||||
}
|
||||
}
|
||||
|
|
@ -1640,7 +1640,7 @@ trait DiagnosticLoggingAdapter extends LoggingAdapter {
|
|||
|
||||
import Logging._
|
||||
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
private var _mdc = emptyMDC
|
||||
|
||||
|
|
@ -1705,7 +1705,7 @@ class LogMarker(val name: String, val properties: Map[String, Any]) {
|
|||
|
||||
/** Java API */
|
||||
def getProperties: java.util.Map[String, Object] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
properties.map { case (k, v) => (k, v.asInstanceOf[AnyRef]) }.asJava
|
||||
}
|
||||
|
||||
|
|
@ -1726,7 +1726,7 @@ object LogMarker {
|
|||
|
||||
/** Java API */
|
||||
def create(name: String, properties: java.util.Map[String, Any]): LogMarker = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
apply(name, properties.asScala.toMap)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import pekko.io.Inet._
|
|||
import pekko.util.{ ByteString, Helpers }
|
||||
import pekko.util.Helpers.Requiring
|
||||
import scala.jdk.DurationConverters._
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* TCP Extension for Akka’s IO layer.
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ object UdpMessage {
|
|||
|
||||
import Udp._
|
||||
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Each [[Udp.Send]] can optionally request a positive acknowledgment to be sent
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ object UdpConnectedMessage {
|
|||
def resumeReading: Command = ResumeReading
|
||||
|
||||
implicit private def fromJava[T](coll: JIterable[T]): immutable.Iterable[T] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
coll.asScala.to(immutable.Iterable)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import org.apache.pekko
|
|||
import pekko.actor.NoSerializationVerificationNeeded
|
||||
import pekko.io.IpVersionSelector
|
||||
import pekko.routing.ConsistentHashingRouter.ConsistentHashable
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Supersedes [[pekko.io.Dns]] protocol.
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ import pekko.io.dns.internal.{ ResolvConf, ResolvConfParser }
|
|||
import pekko.util.Helpers
|
||||
import pekko.util.Helpers.Requiring
|
||||
import scala.jdk.DurationConverters._
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/** INTERNAL API */
|
||||
@InternalApi
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ import java.nio.file.Files
|
|||
|
||||
import scala.util.Try
|
||||
|
||||
import org.apache.pekko
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
private[dns] case class ResolvConf(search: List[String], ndots: Int)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import pekko.actor.{
|
|||
ExtensionIdProvider
|
||||
}
|
||||
import pekko.pattern.internal.CircuitBreakerTelemetryProvider
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Companion object providing factory methods for Circuit Breaker which runs callbacks in caller's thread
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import java.util.{ List => JList }
|
|||
import org.apache.pekko
|
||||
import pekko.actor.ExtendedActorSystem
|
||||
import pekko.annotation.{ InternalApi, InternalStableApi }
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Service Provider Interface (SPI) for collecting metrics from Circuit Breaker.
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ object ConsistentHash {
|
|||
* Java API: Factory method to create a ConsistentHash
|
||||
*/
|
||||
def create[T](nodes: java.lang.Iterable[T], virtualNodesFactor: Int): ConsistentHash[T] = {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
apply(nodes.asScala, virtualNodesFactor)(ClassTag(classOf[Any].asInstanceOf[Class[T]]))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ final case class SeveralRoutees(routees: immutable.IndexedSeq[Routee]) extends R
|
|||
* Java API
|
||||
*/
|
||||
def getRoutees(): java.util.List[Routee] = {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
routees.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ final case class Routees(routees: immutable.IndexedSeq[Routee]) {
|
|||
* Java API
|
||||
*/
|
||||
def getRoutees: java.util.List[Routee] = {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
routees.asJava
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ object Serialization {
|
|||
}
|
||||
|
||||
private final def configToMap(cfg: Config): Map[String, String] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
cfg.root.unwrapped.asScala.toMap.map { case (k, v) => k -> v.toString }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import scala.collection.immutable
|
|||
import org.apache.pekko
|
||||
import pekko.actor.ExtendedActorSystem
|
||||
import pekko.actor.setup.Setup
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
object SerializationSetup {
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import java.util.concurrent.{ ConcurrentHashMap, ConcurrentSkipListSet }
|
|||
|
||||
import scala.annotation.tailrec
|
||||
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* An implementation of a ConcurrentMultiMap
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* license agreements; and to You under the Apache License, version 2.0:
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* This file is part of the Apache Pekko project, which was derived from Akka.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Scala (https://www.scala-lang.org)
|
||||
*
|
||||
* Copyright EPFL and Lightbend, Inc.
|
||||
*
|
||||
* Licensed under Apache License 2.0
|
||||
* (http://www.apache.org/licenses/LICENSE-2.0).
|
||||
*
|
||||
* See the NOTICE file distributed with this work for
|
||||
* additional information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
package org.apache.pekko.util
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
*
|
||||
* Based on https://github.com/scala/scala-collection-compat/blob/master/compat/src/main/scala-2.13/scala/collection/compat/package.scala
|
||||
* but reproduced here so we don't need to add a dependency on this library. It contains much more than we need right now, and is
|
||||
* not promising binary compatibility yet at the time of writing.
|
||||
*/
|
||||
package object ccompat {
|
||||
private[pekko] type Factory[-A, +C] = scala.collection.Factory[A, C]
|
||||
private[pekko] val Factory = scala.collection.Factory
|
||||
|
||||
// When we drop support for 2.12 we can delete this concept
|
||||
// and import scala.jdk.CollectionConverters.Ops._ instead
|
||||
object JavaConverters
|
||||
extends scala.collection.convert.AsJavaExtensions
|
||||
with scala.collection.convert.AsScalaExtensions
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ import org.openjdk.jmh.runner.options.CommandLineOptions
|
|||
|
||||
object BenchRunner {
|
||||
def main(args: Array[String]) = {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
val args2 = args.toList.flatMap {
|
||||
case "quick" => "-i 1 -wi 1 -f1 -t1".split(" ").toList
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ final case class ClusterMetricsChanged(nodeMetrics: Set[NodeMetrics]) extends Cl
|
|||
/** Java API */
|
||||
@nowarn("msg=deprecated")
|
||||
def getNodeMetrics: java.lang.Iterable[NodeMetrics] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
nodeMetrics.asJava
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ final case class NodeMetrics(address: Address, timestamp: Long, metrics: Set[Met
|
|||
*/
|
||||
@nowarn("msg=deprecated")
|
||||
def getMetrics: java.lang.Iterable[Metric] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
metrics.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import pekko.dispatch.Dispatchers
|
|||
import pekko.protobufv3.internal.MessageLite
|
||||
import pekko.remote.ByteStringUtils
|
||||
import pekko.serialization.{ BaseSerializer, SerializationExtension, SerializerWithStringManifest, Serializers }
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Protobuf serializer for [[pekko.cluster.metrics.ClusterMetricsMessage]] types.
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import pekko.persistence.typed.ReplicaId
|
|||
|
||||
import scala.collection.immutable
|
||||
import scala.reflect.ClassTag
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
import java.util.{ Set => JSet }
|
||||
|
||||
import pekko.actor.typed.Behavior
|
||||
|
|
|
|||
|
|
@ -152,13 +152,13 @@ object ShardingProducerController {
|
|||
|
||||
/** Java API */
|
||||
def getEntitiesWithDemand: java.util.Set[String] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
entitiesWithDemand.asJava
|
||||
}
|
||||
|
||||
/** Java API */
|
||||
def getBufferedForEntitiesWithoutDemand: java.util.Map[String, Integer] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
bufferedForEntitiesWithoutDemand.iterator.map { case (k, v) => k -> v.asInstanceOf[Integer] }.toMap.asJava
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import pekko.actor.typed.scaladsl.LoggerOps
|
|||
import pekko.cluster.ClusterSettings.DataCenter
|
||||
import pekko.cluster.sharding.typed.ShardingDirectReplication
|
||||
import pekko.persistence.typed.ReplicationId
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import pekko.event.Logging
|
|||
import pekko.pattern.BackoffOpts
|
||||
import pekko.pattern.ask
|
||||
import pekko.util.ByteString
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* This extension provides sharding functionality of actors in a cluster.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import pekko.pattern.ask
|
|||
import pekko.util.Timeout
|
||||
import pekko.annotation.InternalApi
|
||||
import pekko.pattern.AskTimeoutException
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
import scala.jdk.DurationConverters._
|
||||
|
||||
import scala.concurrent.ExecutionContext
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ private[pekko] object Shard {
|
|||
}
|
||||
}
|
||||
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
// only called once during handoff
|
||||
def activeEntities(): Set[ActorRef] = byRef.keySet.asScala.toSet
|
||||
|
||||
|
|
|
|||
|
|
@ -211,14 +211,14 @@ object ShardCoordinator {
|
|||
shardId: ShardId,
|
||||
currentShardAllocations: Map[ActorRef, immutable.IndexedSeq[ShardId]]): Future[ActorRef] = {
|
||||
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
allocateShard(requester, shardId, currentShardAllocations.asJava)
|
||||
}
|
||||
|
||||
override final def rebalance(
|
||||
currentShardAllocations: Map[ActorRef, immutable.IndexedSeq[ShardId]],
|
||||
rebalanceInProgress: Set[ShardId]): Future[Set[ShardId]] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
implicit val ec = ExecutionContext.parasitic
|
||||
rebalance(currentShardAllocations.asJava, rebalanceInProgress.asJava).map(_.asScala.toSet)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ object ShardRegion {
|
|||
* Java API
|
||||
*/
|
||||
def getRegions: java.util.Set[Address] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
regions.asJava
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ object ShardRegion {
|
|||
* Java API
|
||||
*/
|
||||
def getRegions(): java.util.Map[Address, ShardRegionStats] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
regions.asJava
|
||||
}
|
||||
}
|
||||
|
|
@ -325,13 +325,13 @@ object ShardRegion {
|
|||
* Java API
|
||||
*/
|
||||
def getStats(): java.util.Map[ShardId, Int] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
stats.asJava
|
||||
}
|
||||
|
||||
/** Java API */
|
||||
def getFailed(): java.util.Set[ShardId] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
failed.asJava
|
||||
}
|
||||
|
||||
|
|
@ -391,13 +391,13 @@ object ShardRegion {
|
|||
* If gathering the shard information times out the set of shards will be empty.
|
||||
*/
|
||||
def getShards(): java.util.Set[ShardState] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
shards.asJava
|
||||
}
|
||||
|
||||
/** Java API */
|
||||
def getFailed(): java.util.Set[ShardId] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
failed.asJava
|
||||
}
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ object ShardRegion {
|
|||
* Java API:
|
||||
*/
|
||||
def getEntityIds(): java.util.Set[EntityId] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
entityIds.asJava
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ package org.apache.pekko.cluster.sharding.external
|
|||
import org.apache.pekko
|
||||
import pekko.cluster.sharding.ShardRegion.ShardId
|
||||
import pekko.cluster.sharding.external.ExternalShardAllocationStrategy.ShardLocation
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
final class ShardLocations(val locations: Map[ShardId, ShardLocation]) {
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ import scala.jdk.FutureConverters._
|
|||
import scala.jdk.DurationConverters._
|
||||
import pekko.util.PrettyDuration._
|
||||
import pekko.util.Timeout
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import pekko.protobufv3.internal.MessageLite
|
|||
import pekko.serialization.BaseSerializer
|
||||
import pekko.serialization.Serialization
|
||||
import pekko.serialization.SerializerWithStringManifest
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API: Protobuf serializer of ClusterSharding messages.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ package org.apache.pekko.cluster.sharding.passivation.simulator
|
|||
|
||||
import org.apache.pekko
|
||||
import pekko.japi.Util.immutableSeq
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
import com.typesafe.config.Config
|
||||
|
||||
import java.util.Locale
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import pekko.remote.DeadlineFailureDetector
|
|||
import pekko.routing.ConsistentHash
|
||||
import pekko.routing.MurmurHash
|
||||
import pekko.util.MessageBuffer
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
@deprecated(
|
||||
"Use Pekko gRPC instead, see https://pekko.apache.org/docs/pekko/current/cluster-client.html#migration-to-pekko-grpc",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import pekko.cluster.client.ClusterReceptionist
|
|||
import pekko.cluster.client.protobuf.msg.{ ClusterClientMessages => cm }
|
||||
import pekko.serialization.BaseSerializer
|
||||
import pekko.serialization.SerializerWithStringManifest
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API: Serializer of ClusterClient messages.
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ object DistributedPubSubMediator {
|
|||
* Java API
|
||||
*/
|
||||
def getTopics(): java.util.Set[String] = {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
topics.asJava
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import pekko.cluster.pubsub.protobuf.msg.{ DistributedPubSubMessages => dm }
|
|||
import pekko.protobufv3.internal.{ ByteString, MessageLite }
|
||||
import pekko.remote.ByteStringUtils
|
||||
import pekko.serialization._
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API: Protobuf serializer of DistributedPubSubMediator messages.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import pekko.remote.ContainerFormats.Payload
|
|||
import pekko.remote.serialization.WrappedPayloadSupport
|
||||
import pekko.serialization.BaseSerializer
|
||||
import pekko.serialization.SerializerWithStringManifest
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
import pekko.protobufv3.internal.ByteString
|
||||
import pekko.remote.ByteStringUtils
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
|
|||
* Java API: roles that this member has
|
||||
*/
|
||||
def getSelfRoles: java.util.Set[String] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
selfRoles.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import pekko.cluster.ClusterSettings.DataCenter
|
|||
import pekko.cluster.MemberStatus._
|
||||
import pekko.dispatch.{ RequiresMessageQueue, UnboundedMessageQueueSemantics }
|
||||
import pekko.event.EventStream
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Domain events published to the event bus.
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import pekko.actor.AddressFromURIString
|
|||
import pekko.annotation.InternalApi
|
||||
import pekko.util.Helpers.{ toRootLowerCase, ConfigOps, Requiring }
|
||||
import pekko.util.Version
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
object ClusterSettings {
|
||||
type DataCenter = String
|
||||
|
|
@ -175,7 +175,7 @@ final class ClusterSettings(val config: Config, val systemName: String) {
|
|||
cc.getInt("min-nr-of-members")
|
||||
}.requiring(_ > 0, "min-nr-of-members must be > 0")
|
||||
val MinNrOfMembersOfRole: Map[String, Int] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
cc.getConfig("role")
|
||||
.root
|
||||
.asScala
|
||||
|
|
@ -195,7 +195,7 @@ final class ClusterSettings(val config: Config, val systemName: String) {
|
|||
|
||||
val ByPassConfigCompatCheck: Boolean = !cc.getBoolean("configuration-compatibility-check.enforce-on-join")
|
||||
val ConfigCompatCheckers: Set[String] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
cc.getConfig("configuration-compatibility-check.checkers")
|
||||
.root
|
||||
.unwrapped
|
||||
|
|
@ -209,7 +209,7 @@ final class ClusterSettings(val config: Config, val systemName: String) {
|
|||
}
|
||||
|
||||
val SensitiveConfigPaths = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
val sensitiveKeys =
|
||||
cc.getConfig("configuration-compatibility-check.sensitive-config-paths")
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ private[cluster] object ConfigUtil {
|
|||
}
|
||||
|
||||
def adaptPekkoToAkkaConfig(cfg: Config): Config = {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
val innerSet = cfg.entrySet().asScala
|
||||
.filter(e => e.getKey.startsWith("pekko.") && e.getValue.valueType() != ConfigValueType.OBJECT)
|
||||
.map { entry =>
|
||||
|
|
@ -48,7 +48,7 @@ private[cluster] object ConfigUtil {
|
|||
}
|
||||
|
||||
def adaptAkkaToPekkoConfig(cfg: Config): Config = {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
val innerSet = cfg.entrySet().asScala
|
||||
.filter(e => e.getKey.startsWith("akka.") && e.getValue.valueType() != ConfigValueType.OBJECT)
|
||||
.map { entry =>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import com.typesafe.config.{ Config, ConfigFactory, ConfigValue }
|
|||
import org.apache.pekko
|
||||
import pekko.actor.ExtendedActorSystem
|
||||
import pekko.annotation.{ DoNotInherit, InternalApi }
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
abstract class JoinConfigCompatChecker {
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class Member private[cluster] (
|
|||
*/
|
||||
@nowarn("msg=deprecated")
|
||||
def getRoles: java.util.Set[String] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
roles.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import pekko.remote.ByteStringUtils
|
|||
import pekko.routing.Pool
|
||||
import pekko.serialization._
|
||||
import pekko.util.Version
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import pekko.routing.RouterConfig
|
|||
import pekko.routing.RouterPoolActor
|
||||
import pekko.routing.RoutingLogic
|
||||
import pekko.util.HashCode
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
object ClusterRouterGroupSettings {
|
||||
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ abstract class StressSpec extends MultiNodeClusterSpec(StressMultiJvmSpec) with
|
|||
.append(" MB")
|
||||
sb.append("\n")
|
||||
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
val args = runtime.getInputArguments.asScala.filterNot(_.contains("classpath")).mkString("\n ")
|
||||
sb.append("Args:\n ").append(args)
|
||||
sb.append("\n")
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import pekko.actor.ExtensionIdProvider
|
|||
import pekko.coordination.lease.scaladsl.Lease
|
||||
import pekko.event.Logging
|
||||
import pekko.testkit.TestProbe
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
object TestLeaseExt extends ExtensionId[TestLeaseExt] with ExtensionIdProvider {
|
||||
override def get(system: ActorSystem): TestLeaseExt = super.get(system)
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ object ServiceDiscovery {
|
|||
* Java API
|
||||
*/
|
||||
def getAddresses: java.util.List[ResolvedTarget] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
addresses.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import pekko.discovery.aggregate.AggregateServiceDiscovery.Methods
|
|||
import pekko.dispatch.MessageDispatcher
|
||||
import pekko.event.Logging
|
||||
import pekko.util.Helpers.Requiring
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import pekko.annotation.InternalApi
|
|||
import pekko.discovery.{ Lookup, ServiceDiscovery }
|
||||
import pekko.discovery.ServiceDiscovery.{ Resolved, ResolvedTarget }
|
||||
import pekko.event.Logging
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ final case class GSet[A] private (elements: Set[A])(override val delta: Option[G
|
|||
* Java API
|
||||
*/
|
||||
def getElements(): java.util.Set[A] = {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
elements.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ final case class GSet[A] private (elements: Set[A])(override val delta: Option[G
|
|||
* Java API
|
||||
*/
|
||||
def getElements(): java.util.Set[A] = {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
elements.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import pekko.serialization.SerializationExtension
|
|||
import pekko.serialization.SerializerWithStringManifest
|
||||
import pekko.util.ByteString
|
||||
import pekko.util.OptionVal
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* An actor implementing the durable store for the Distributed Data `Replicator`
|
||||
|
|
@ -312,7 +312,7 @@ final class LmdbDurableStore(config: Config) extends Actor with ActorLogging {
|
|||
TimeUnit.NANOSECONDS.toMillis(System.nanoTime - t0))
|
||||
} catch {
|
||||
case NonFatal(e) =>
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
log.error(e, "failed to store [{}]", pending.keySet.asScala.mkString(","))
|
||||
tx.abort()
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ final class LWWMap[A, B] private[pekko] (private[pekko] val underlying: ORMap[A,
|
|||
* Java API: All entries of the map.
|
||||
*/
|
||||
def getEntries(): java.util.Map[A, B] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
entries.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ final class ORMap[A, B <: ReplicatedData] private[pekko] (
|
|||
* Java API: All entries of the map.
|
||||
*/
|
||||
def getEntries(): java.util.Map[A, B] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
entries.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ final class ORMultiMap[A, B] private[pekko] (
|
|||
* 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 pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
val result = new java.util.HashMap[A, java.util.Set[B]]
|
||||
if (withValueDeltas)
|
||||
underlying.entries.foreach {
|
||||
|
|
@ -167,7 +167,7 @@ final class ORMultiMap[A, B] private[pekko] (
|
|||
* replicated data set.
|
||||
*/
|
||||
def put(node: SelfUniqueAddress, key: A, value: java.util.Set[B]): ORMultiMap[A, B] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
put(node.uniqueAddress, key, value.asScala.toSet)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ final class ORSet[A] private[pekko] (
|
|||
* Java API
|
||||
*/
|
||||
def getElements(): java.util.Set[A] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
elements.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ final class PNCounterMap[A] private[pekko] (private[pekko] val underlying: ORMap
|
|||
|
||||
/** Java API */
|
||||
def getEntries: java.util.Map[A, BigInteger] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
underlying.entries.map { case (k, c) => k -> c.value.bigInteger }.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ object ReplicatorSettings {
|
|||
else Some(config.getBytes("log-data-size-exceeding").toInt)
|
||||
}
|
||||
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
new ReplicatorSettings(
|
||||
roles = roleOption(config.getString("role")).toSet,
|
||||
gossipInterval = config.getDuration("gossip-interval", MILLISECONDS).millis,
|
||||
|
|
@ -231,7 +231,7 @@ final class ReplicatorSettings(
|
|||
* Java API
|
||||
*/
|
||||
def withDurableKeys(durableKeys: java.util.Set[String]): ReplicatorSettings = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
withDurableKeys(durableKeys.asScala.toSet)
|
||||
}
|
||||
|
||||
|
|
@ -408,7 +408,7 @@ object Replicator {
|
|||
* Java API
|
||||
*/
|
||||
def getKeyIds: java.util.Set[String] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
keyIds.asJava
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import pekko.serialization.BaseSerializer
|
|||
import pekko.serialization.Serialization
|
||||
import pekko.serialization.SerializerWithStringManifest
|
||||
import pekko.util.ByteString.UTF_8
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
private object ReplicatedDataSerializer {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import pekko.serialization.BaseSerializer
|
|||
import pekko.serialization.Serialization
|
||||
import pekko.serialization.SerializerWithStringManifest
|
||||
import pekko.util.{ ByteString => PekkoByteString }
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import pekko.protobufv3.internal.ByteString
|
|||
import pekko.protobufv3.internal.MessageLite
|
||||
import pekko.remote.ByteStringUtils
|
||||
import pekko.serialization._
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Some useful serialization helper methods.
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ class DistributedDataDocSpec extends PekkoSpec(DistributedDataDocSpec.config) {
|
|||
}
|
||||
|
||||
"test japi.TwoPhaseSetSerializer" in {
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
val s1 = ddata.TwoPhaseSet.create().add("a").add("b").add("c").remove("b")
|
||||
s1.getElements.asScala should be(Set("a", "c"))
|
||||
val serializer = SerializationExtension(system).findSerializerFor(s1)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ package docs.ddata.protobuf
|
|||
import java.util.ArrayList
|
||||
import java.util.Collections
|
||||
import org.apache.pekko
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
import pekko.actor.ExtendedActorSystem
|
||||
import pekko.cluster.ddata.GSet
|
||||
import pekko.cluster.ddata.protobuf.SerializationSupport
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import org.apache.pekko.actor.Props
|
|||
import org.apache.pekko.io.Udp
|
||||
import org.apache.pekko.testkit.SocketUtil
|
||||
import org.apache.pekko.testkit.TestKit
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
import org.scalatest.BeforeAndAfterAll
|
||||
import org.scalatest.matchers.should.Matchers
|
||||
import org.scalatest.wordspec.AnyWordSpecLike
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ object PersistenceQueryDocSpec {
|
|||
// possibility to add more plugin specific queries
|
||||
|
||||
def byTagsWithMeta(tags: java.util.Set[String]): javadsl.Source[RichEvent, QueryMetadata] = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
scaladslReadJournal.byTagsWithMeta(tags.asScala.toSet).asJava
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import org.apache.pekko.routing.ScatterGatherFirstCompletedPool
|
|||
import org.apache.pekko.routing.BalancingPool
|
||||
import org.apache.pekko.routing.TailChoppingGroup
|
||||
import org.apache.pekko.routing.TailChoppingPool
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
object RouterDocSpec {
|
||||
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ object MultiNodeSpec {
|
|||
""")
|
||||
|
||||
private def mapToConfig(map: Map[String, Any]): Config = {
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
ConfigFactory.parseMap(map.asJava)
|
||||
}
|
||||
|
||||
|
|
@ -521,7 +521,7 @@ abstract class MultiNodeSpec(
|
|||
base.replace(tag, replaceWith)
|
||||
}
|
||||
}
|
||||
import pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
ConfigFactory.parseString(deployString).root.asScala.foreach {
|
||||
case (key, value: ConfigObject) => deployer.parseConfig(key, value.toConfig).foreach(deployer.deploy)
|
||||
case (key, x) =>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import scala.util.Try
|
|||
import org.osgi.framework.{ Bundle, BundleContext }
|
||||
import org.osgi.framework.wiring.{ BundleRevision, BundleWire, BundleWiring }
|
||||
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/*
|
||||
* Companion object to create bundle delegating ClassLoader instances
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.apache.commons.io.IOUtils.copy
|
|||
import org.osgi.framework._
|
||||
import org.scalatest.{ BeforeAndAfterAll, Suite }
|
||||
|
||||
import org.apache.pekko.util.ccompat.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
|
||||
/**
|
||||
* Trait that provides support for building pekko-osgi tests using PojoSR
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue