Apply scalaFmt (#5415)
diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/InstanceConcurrencyLimit.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/InstanceConcurrencyLimit.scala
index c6edc88..c027d25 100644
--- a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/InstanceConcurrencyLimit.scala
+++ b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/InstanceConcurrencyLimit.scala
@@ -39,7 +39,7 @@
*
* @param maxConcurrentInstances the max number of concurrent activations in a single container
*/
-protected[entity] class InstanceConcurrencyLimit private(val maxConcurrentInstances: Int) extends AnyVal
+protected[entity] class InstanceConcurrencyLimit private (val maxConcurrentInstances: Int) extends AnyVal
protected[core] object InstanceConcurrencyLimit extends ArgNormalizer[InstanceConcurrencyLimit] {
diff --git a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/IntraConcurrencyLimit.scala b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/IntraConcurrencyLimit.scala
index ccf5534..f34d810 100644
--- a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/IntraConcurrencyLimit.scala
+++ b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/IntraConcurrencyLimit.scala
@@ -42,7 +42,7 @@
*
* @param maxConcurrent the max number of concurrent activations in a single container
*/
-protected[entity] class IntraConcurrencyLimit private(val maxConcurrent: Int) extends AnyVal {
+protected[entity] class IntraConcurrencyLimit private (val maxConcurrent: Int) extends AnyVal {
/** It checks the namespace memory limit setting value */
@throws[ActionConcurrencyLimitException]
diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Limits.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Limits.scala
index d621bc6..0d54e73 100644
--- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Limits.scala
+++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Limits.scala
@@ -24,7 +24,7 @@
import org.apache.openwhisk.core.WhiskConfig
import org.apache.openwhisk.core.entitlement.{Collection, Privilege, Resource}
import org.apache.openwhisk.core.entitlement.Privilege.READ
-import org.apache.openwhisk.core.entity.{IntraConcurrencyLimit, Identity, LogLimit, MemoryLimit, TimeLimit}
+import org.apache.openwhisk.core.entity.{Identity, IntraConcurrencyLimit, LogLimit, MemoryLimit, TimeLimit}
trait WhiskLimitsApi extends Directives with AuthenticatedRouteProvider with AuthorizedRouteProvider {
@@ -65,8 +65,7 @@
maxActionConcurrency = Some(IntraConcurrencyLimit(user.limits.allowedMaxActionConcurrency)),
minActionConcurrency = Some(IntraConcurrencyLimit(user.limits.allowedMinActionConcurrency)),
maxParameterSize = Some(user.limits.allowedMaxParameterSize),
- maxActionInstances =
- Some(user.limits.concurrentInvocations.getOrElse(concurrentInvocationsSystemDefault)))
+ maxActionInstances = Some(user.limits.concurrentInvocations.getOrElse(concurrentInvocationsSystemDefault)))
pathEndOrSingleSlash { complete(OK, limits) }
case _ => reject //should never get here
}
diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala
index c1688ac..161ee14 100644
--- a/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala
+++ b/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala
@@ -67,7 +67,8 @@
/** Creates an invoker for executing user actions. There is only one invoker in the lean model. */
private def makeALocalThreadedInvoker(): Unit = {
implicit val ec = ExecutionContextFactory.makeCachedThreadPoolExecutionContext()
- val limitConfig: IntraConcurrencyLimitConfig = loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit)
+ val limitConfig: IntraConcurrencyLimitConfig =
+ loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit)
SpiLoader.get[InvokerProvider].instance(config, invokerName, messageProducer, poolConfig, limitConfig)
}
diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/Invoker.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/Invoker.scala
index 5928097..1d31175 100644
--- a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/Invoker.scala
+++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/Invoker.scala
@@ -107,7 +107,8 @@
ActorSystem(name = "invoker-actor-system", defaultExecutionContext = Some(ec))
implicit val logger = new AkkaLogging(akka.event.Logging.getLogger(actorSystem, this))
val poolConfig: ContainerPoolConfig = loadConfigOrThrow[ContainerPoolConfig](ConfigKeys.containerPool)
- val limitConfig: IntraConcurrencyLimitConfig = loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit)
+ val limitConfig: IntraConcurrencyLimitConfig =
+ loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit)
val tags: Seq[String] = Some(loadConfigOrThrow[String](ConfigKeys.invokerResourceTags))
.map(_.trim())
.filter(_ != "")
@@ -236,11 +237,12 @@
* An Spi for providing invoker implementation.
*/
trait InvokerProvider extends Spi {
- def instance(config: WhiskConfig,
- instance: InvokerInstanceId,
- producer: MessageProducer,
- poolConfig: ContainerPoolConfig,
- limitsConfig: IntraConcurrencyLimitConfig)(implicit actorSystem: ActorSystem, logging: Logging): InvokerCore
+ def instance(
+ config: WhiskConfig,
+ instance: InvokerInstanceId,
+ producer: MessageProducer,
+ poolConfig: ContainerPoolConfig,
+ limitsConfig: IntraConcurrencyLimitConfig)(implicit actorSystem: ActorSystem, logging: Logging): InvokerCore
}
// this trait can be used to add common implementation
diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala
index 17d9c9b..ab265d0 100644
--- a/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala
+++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala
@@ -59,9 +59,8 @@
instance: InvokerInstanceId,
producer: MessageProducer,
poolConfig: ContainerPoolConfig = loadConfigOrThrow[ContainerPoolConfig](ConfigKeys.containerPool),
- limitsConfig: IntraConcurrencyLimitConfig = loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit))(
- implicit actorSystem: ActorSystem,
- logging: Logging)
+ limitsConfig: IntraConcurrencyLimitConfig = loadConfigOrThrow[IntraConcurrencyLimitConfig](
+ ConfigKeys.concurrencyLimit))(implicit actorSystem: ActorSystem, logging: Logging)
extends InvokerCore {
implicit val ec: ExecutionContext = actorSystem.dispatcher
diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/KafkaLauncher.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/KafkaLauncher.scala
index 41e91e4..a7be4ab 100644
--- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/KafkaLauncher.scala
+++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/KafkaLauncher.scala
@@ -68,8 +68,8 @@
val t = Try {
createDir("zookeeper")
createDir("kafka")
- EmbeddedKafka.startZooKeeper(FileSystems.getDefault.getPath(workDir.getPath,"zookeeper"))
- EmbeddedKafka.startKafka(FileSystems.getDefault.getPath(workDir.getPath,"kafka"))
+ EmbeddedKafka.startZooKeeper(FileSystems.getDefault.getPath(workDir.getPath, "zookeeper"))
+ EmbeddedKafka.startKafka(FileSystems.getDefault.getPath(workDir.getPath, "kafka"))
}
Future
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
index ef6d8d3..82ffe82 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
@@ -955,13 +955,7 @@
val content = WhiskActionPut(
Some(jsDefault("_")),
Some(Parameters("x", "X")),
- Some(
- ActionLimitsOption(
- None,
- None,
- None,
- None,
- Some(InstanceConcurrencyLimit(40)))))
+ Some(ActionLimitsOption(None, None, None, None, Some(InstanceConcurrencyLimit(40)))))
Put(s"$collectionPath/${aname()}", content) ~> Route.seal(routes(credsWithNamespaceLimits)) ~> check {
status should be(BadRequest)
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/LimitsApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/LimitsApiTests.scala
index 2d66929..1b2f46e 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/LimitsApiTests.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/LimitsApiTests.scala
@@ -23,7 +23,14 @@
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller
import akka.http.scaladsl.server.Route
import org.apache.openwhisk.core.controller.WhiskLimitsApi
-import org.apache.openwhisk.core.entity.{IntraConcurrencyLimit, EntityPath, LogLimit, MemoryLimit, TimeLimit, UserLimits}
+import org.apache.openwhisk.core.entity.{
+ EntityPath,
+ IntraConcurrencyLimit,
+ LogLimit,
+ MemoryLimit,
+ TimeLimit,
+ UserLimits
+}
import org.apache.openwhisk.core.entity.size._
import scala.concurrent.duration._
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidatorTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidatorTests.scala
index a40ed64..936f483 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidatorTests.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidatorTests.scala
@@ -27,7 +27,15 @@
import org.apache.openwhisk.common.{AkkaLogging, TransactionId}
import org.apache.openwhisk.core.database.{CacheInvalidationMessage, RemoteCacheInvalidation}
import org.apache.openwhisk.core.database.cosmosdb.{CosmosDBArtifactStoreProvider, CosmosDBTestSupport}
-import org.apache.openwhisk.core.entity.{DocumentReader, EntityName, EntityPath, WhiskDocumentReader, WhiskEntity, WhiskEntityJsonFormat, WhiskPackage}
+import org.apache.openwhisk.core.entity.{
+ DocumentReader,
+ EntityName,
+ EntityPath,
+ WhiskDocumentReader,
+ WhiskEntity,
+ WhiskEntityJsonFormat,
+ WhiskPackage
+}
import org.junit.runner.RunWith
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.junit.JUnitRunner
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala
index e35b9ec..7fe7574 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala
@@ -43,8 +43,8 @@
ActivationEntityLimit,
ActivationResponse,
ByteSize,
- IntraConcurrencyLimit,
Exec,
+ IntraConcurrencyLimit,
LogLimit,
MemoryLimit,
TimeLimit
@@ -125,13 +125,13 @@
case Some(l) => s"${l} (allowed)"
}
val toConcurrencyString = concurrency match {
- case None => "None"
+ case None => "None"
case Some(IntraConcurrencyLimit.MIN_CONCURRENT) => s"${IntraConcurrencyLimit.MIN_CONCURRENT} (= min)"
case Some(IntraConcurrencyLimit.STD_CONCURRENT) => s"${IntraConcurrencyLimit.STD_CONCURRENT} (= std)"
case Some(IntraConcurrencyLimit.MAX_CONCURRENT) => s"${IntraConcurrencyLimit.MAX_CONCURRENT} (= max)"
case Some(c) if (c < IntraConcurrencyLimit.MIN_CONCURRENT) => s"${c} (< min)"
case Some(c) if (c > IntraConcurrencyLimit.MAX_CONCURRENT) => s"${c} (> max)"
- case Some(c) => s"${c} (allowed)"
+ case Some(c) => s"${c} (allowed)"
}
val toExpectedResultString: String = if (ec == SUCCESS_EXIT) "allow" else "reject"
}