Skip to content

Commit

Permalink
Reformat with scalafmt 3.8.2
Browse files Browse the repository at this point in the history
Executed command: scalafmt --non-interactive
  • Loading branch information
scala-steward committed Jun 14, 2024
1 parent 1a7a04a commit 6460b1e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
3 changes: 2 additions & 1 deletion core/src/main/scala/tasks/caching/TaskSerializer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ trait TaskSerializer {
def deserializeResult(byteArray: Array[Byte]): UntypedResult = {
readFromArray[UntypedResult](
byteArray,
config = ReaderConfig.withMaxBufSize(2147483645)
config = ReaderConfig
.withMaxBufSize(2147483645)
.withMaxCharBufSize(2147483645)
)
}
Expand Down
16 changes: 9 additions & 7 deletions core/src/main/scala/tasks/queue/Queue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,10 @@ class TaskQueue(
case AskForWork(availableResource) =>
if (state.negotiation.isEmpty) {
scribe.debug(
s"AskForWork ${sender()} $availableResource ${state.negotiation} ${state.queuedTasks.map { case (_, (sch, _)) =>
(sch.description.taskId, sch.resource)
}.toSeq}"
s"AskForWork ${sender()} $availableResource ${state.negotiation} ${state.queuedTasks.map {
case (_, (sch, _)) =>
(sch.description.taskId, sch.resource)
}.toSeq}"
)

val launcher = LauncherActor(sender())
Expand All @@ -241,7 +242,9 @@ class TaskQueue(
state.queuedTasks.valuesIterator
.foreach { case (sch, _) =>
val ret = availableResource.canFulfillRequest(sch.resource)
if (!ret && (maxPrio == Int.MinValue || sch.priority.toInt > maxPrio)) {
if (
!ret && (maxPrio == Int.MinValue || sch.priority.toInt > maxPrio)
) {
log.debug(
s"Can't fulfill request ${sch.resource} with available resources $availableResource or lower priority than an already selected task"
)
Expand All @@ -255,7 +258,6 @@ class TaskQueue(
selected match {
case None => launcher.actor ! NothingForSchedule
case Some(sch) =>

val withNegotiation = state.update(Negotiating(launcher, sch))
log.info(
s"Dequeued task ${sch.description.taskId.id} with priority ${sch.priority}. Sending task to $launcher. (Negotation state of queue: ${state.negotiation})"
Expand All @@ -273,8 +275,8 @@ class TaskQueue(
context.become(running(newState))

launcher.actor ! Schedule(sch)
}
}

} else {
log.debug("AskForWork received but currently in negotiation state.")
}
Expand Down
14 changes: 8 additions & 6 deletions core/src/main/scala/tasks/queue/Task.scala
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ private[tasks] case class UntypedResultWithMetadata(

private[tasks] object UntypedResultWithMetadata {
implicit val codec: JsonValueCodec[UntypedResultWithMetadata] =
JsonCodecMaker.make(CodecMakerConfig
.withMapMaxInsertNumber(2147483645)
.withSetMaxInsertNumber(2147483645)
JsonCodecMaker.make(
CodecMakerConfig
.withMapMaxInsertNumber(2147483645)
.withSetMaxInsertNumber(2147483645)
)
}

Expand All @@ -128,9 +129,10 @@ private[tasks] object UntypedResult {
}

implicit val codec: JsonValueCodec[UntypedResult] =
JsonCodecMaker.make(CodecMakerConfig
.withMapMaxInsertNumber(2147483645)
.withSetMaxInsertNumber(2147483645)
JsonCodecMaker.make(
CodecMakerConfig
.withMapMaxInsertNumber(2147483645)
.withSetMaxInsertNumber(2147483645)
)
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/tasks/wire/messages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private[tasks] case object GetMaximumSlots extends StaticMessage
private[tasks] case object GetAvailableSlots extends StaticMessage

case class Schedule(sch: ScheduleTask) extends StaticMessage
case object NothingForSchedule extends StaticMessage
case object NothingForSchedule extends StaticMessage

// Messages related to elastic

Expand Down

0 comments on commit 6460b1e

Please sign in to comment.