Skip to content

Commit cec7c3f

Browse files
committed
Apply scalaFmt
1 parent 72bb2a1 commit cec7c3f

File tree

11 files changed

+39
-29
lines changed

11 files changed

+39
-29
lines changed

common/scala/src/main/scala/org/apache/openwhisk/core/entity/InstanceConcurrencyLimit.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import spray.json._
3939
*
4040
* @param maxConcurrentInstances the max number of concurrent activations in a single container
4141
*/
42-
protected[entity] class InstanceConcurrencyLimit private(val maxConcurrentInstances: Int) extends AnyVal
42+
protected[entity] class InstanceConcurrencyLimit private (val maxConcurrentInstances: Int) extends AnyVal
4343

4444
protected[core] object InstanceConcurrencyLimit extends ArgNormalizer[InstanceConcurrencyLimit] {
4545

common/scala/src/main/scala/org/apache/openwhisk/core/entity/IntraConcurrencyLimit.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ case class IntraConcurrencyLimitConfig(min: Int, max: Int, std: Int)
4242
*
4343
* @param maxConcurrent the max number of concurrent activations in a single container
4444
*/
45-
protected[entity] class IntraConcurrencyLimit private(val maxConcurrent: Int) extends AnyVal {
45+
protected[entity] class IntraConcurrencyLimit private (val maxConcurrent: Int) extends AnyVal {
4646

4747
/** It checks the namespace memory limit setting value */
4848
@throws[ActionConcurrencyLimitException]

core/controller/src/main/scala/org/apache/openwhisk/core/controller/Limits.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import org.apache.openwhisk.common.TransactionId
2424
import org.apache.openwhisk.core.WhiskConfig
2525
import org.apache.openwhisk.core.entitlement.{Collection, Privilege, Resource}
2626
import org.apache.openwhisk.core.entitlement.Privilege.READ
27-
import org.apache.openwhisk.core.entity.{IntraConcurrencyLimit, Identity, LogLimit, MemoryLimit, TimeLimit}
27+
import org.apache.openwhisk.core.entity.{Identity, IntraConcurrencyLimit, LogLimit, MemoryLimit, TimeLimit}
2828

2929
trait WhiskLimitsApi extends Directives with AuthenticatedRouteProvider with AuthorizedRouteProvider {
3030

@@ -65,8 +65,7 @@ trait WhiskLimitsApi extends Directives with AuthenticatedRouteProvider with Aut
6565
maxActionConcurrency = Some(IntraConcurrencyLimit(user.limits.allowedMaxActionConcurrency)),
6666
minActionConcurrency = Some(IntraConcurrencyLimit(user.limits.allowedMinActionConcurrency)),
6767
maxParameterSize = Some(user.limits.allowedMaxParameterSize),
68-
maxActionInstances =
69-
Some(user.limits.concurrentInvocations.getOrElse(concurrentInvocationsSystemDefault)))
68+
maxActionInstances = Some(user.limits.concurrentInvocations.getOrElse(concurrentInvocationsSystemDefault)))
7069
pathEndOrSingleSlash { complete(OK, limits) }
7170
case _ => reject //should never get here
7271
}

core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class LeanBalancer(config: WhiskConfig,
6767
/** Creates an invoker for executing user actions. There is only one invoker in the lean model. */
6868
private def makeALocalThreadedInvoker(): Unit = {
6969
implicit val ec = ExecutionContextFactory.makeCachedThreadPoolExecutionContext()
70-
val limitConfig: IntraConcurrencyLimitConfig = loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit)
70+
val limitConfig: IntraConcurrencyLimitConfig =
71+
loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit)
7172
SpiLoader.get[InvokerProvider].instance(config, invokerName, messageProducer, poolConfig, limitConfig)
7273
}
7374

core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/Invoker.scala

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ object Invoker {
107107
ActorSystem(name = "invoker-actor-system", defaultExecutionContext = Some(ec))
108108
implicit val logger = new AkkaLogging(akka.event.Logging.getLogger(actorSystem, this))
109109
val poolConfig: ContainerPoolConfig = loadConfigOrThrow[ContainerPoolConfig](ConfigKeys.containerPool)
110-
val limitConfig: IntraConcurrencyLimitConfig = loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit)
110+
val limitConfig: IntraConcurrencyLimitConfig =
111+
loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit)
111112
val tags: Seq[String] = Some(loadConfigOrThrow[String](ConfigKeys.invokerResourceTags))
112113
.map(_.trim())
113114
.filter(_ != "")
@@ -236,11 +237,12 @@ object Invoker {
236237
* An Spi for providing invoker implementation.
237238
*/
238239
trait InvokerProvider extends Spi {
239-
def instance(config: WhiskConfig,
240-
instance: InvokerInstanceId,
241-
producer: MessageProducer,
242-
poolConfig: ContainerPoolConfig,
243-
limitsConfig: IntraConcurrencyLimitConfig)(implicit actorSystem: ActorSystem, logging: Logging): InvokerCore
240+
def instance(
241+
config: WhiskConfig,
242+
instance: InvokerInstanceId,
243+
producer: MessageProducer,
244+
poolConfig: ContainerPoolConfig,
245+
limitsConfig: IntraConcurrencyLimitConfig)(implicit actorSystem: ActorSystem, logging: Logging): InvokerCore
244246
}
245247

246248
// this trait can be used to add common implementation

core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/InvokerReactive.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ class InvokerReactive(
5959
instance: InvokerInstanceId,
6060
producer: MessageProducer,
6161
poolConfig: ContainerPoolConfig = loadConfigOrThrow[ContainerPoolConfig](ConfigKeys.containerPool),
62-
limitsConfig: IntraConcurrencyLimitConfig = loadConfigOrThrow[IntraConcurrencyLimitConfig](ConfigKeys.concurrencyLimit))(
63-
implicit actorSystem: ActorSystem,
64-
logging: Logging)
62+
limitsConfig: IntraConcurrencyLimitConfig = loadConfigOrThrow[IntraConcurrencyLimitConfig](
63+
ConfigKeys.concurrencyLimit))(implicit actorSystem: ActorSystem, logging: Logging)
6564
extends InvokerCore {
6665

6766
implicit val ec: ExecutionContext = actorSystem.dispatcher

core/standalone/src/main/scala/org/apache/openwhisk/standalone/KafkaLauncher.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ class KafkaLauncher(
6868
val t = Try {
6969
createDir("zookeeper")
7070
createDir("kafka")
71-
EmbeddedKafka.startZooKeeper(FileSystems.getDefault.getPath(workDir.getPath,"zookeeper"))
72-
EmbeddedKafka.startKafka(FileSystems.getDefault.getPath(workDir.getPath,"kafka"))
71+
EmbeddedKafka.startZooKeeper(FileSystems.getDefault.getPath(workDir.getPath, "zookeeper"))
72+
EmbeddedKafka.startKafka(FileSystems.getDefault.getPath(workDir.getPath, "kafka"))
7373
}
7474

7575
Future

tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -955,13 +955,7 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
955955
val content = WhiskActionPut(
956956
Some(jsDefault("_")),
957957
Some(Parameters("x", "X")),
958-
Some(
959-
ActionLimitsOption(
960-
None,
961-
None,
962-
None,
963-
None,
964-
Some(InstanceConcurrencyLimit(40)))))
958+
Some(ActionLimitsOption(None, None, None, None, Some(InstanceConcurrencyLimit(40)))))
965959

966960
Put(s"$collectionPath/${aname()}", content) ~> Route.seal(routes(credsWithNamespaceLimits)) ~> check {
967961
status should be(BadRequest)

tests/src/test/scala/org/apache/openwhisk/core/controller/test/LimitsApiTests.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ import akka.http.scaladsl.model.StatusCodes.{BadRequest, MethodNotAllowed, OK}
2323
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonUnmarshaller
2424
import akka.http.scaladsl.server.Route
2525
import org.apache.openwhisk.core.controller.WhiskLimitsApi
26-
import org.apache.openwhisk.core.entity.{IntraConcurrencyLimit, EntityPath, LogLimit, MemoryLimit, TimeLimit, UserLimits}
26+
import org.apache.openwhisk.core.entity.{
27+
EntityPath,
28+
IntraConcurrencyLimit,
29+
LogLimit,
30+
MemoryLimit,
31+
TimeLimit,
32+
UserLimits
33+
}
2734
import org.apache.openwhisk.core.entity.size._
2835

2936
import scala.concurrent.duration._

tests/src/test/scala/org/apache/openwhisk/core/database/cosmosdb/cache/CacheInvalidatorTests.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ import org.apache.kafka.common.serialization.StringDeserializer
2727
import org.apache.openwhisk.common.{AkkaLogging, TransactionId}
2828
import org.apache.openwhisk.core.database.{CacheInvalidationMessage, RemoteCacheInvalidation}
2929
import org.apache.openwhisk.core.database.cosmosdb.{CosmosDBArtifactStoreProvider, CosmosDBTestSupport}
30-
import org.apache.openwhisk.core.entity.{DocumentReader, EntityName, EntityPath, WhiskDocumentReader, WhiskEntity, WhiskEntityJsonFormat, WhiskPackage}
30+
import org.apache.openwhisk.core.entity.{
31+
DocumentReader,
32+
EntityName,
33+
EntityPath,
34+
WhiskDocumentReader,
35+
WhiskEntity,
36+
WhiskEntityJsonFormat,
37+
WhiskPackage
38+
}
3139
import org.junit.runner.RunWith
3240
import org.scalatest.concurrent.ScalaFutures
3341
import org.scalatest.junit.JUnitRunner

0 commit comments

Comments
 (0)