Skip to content

Commit

Permalink
Reformat with scalafmt 3.8.3
Browse files Browse the repository at this point in the history
Executed command: scalafmt --non-interactive
  • Loading branch information
scala-steward authored and pityka committed Sep 5, 2024
1 parent 546a284 commit ae7fba5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 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
13 changes: 7 additions & 6 deletions core/src/main/scala/tasks/queue/Queue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ class TaskQueue(
if (state.negotiation.isEmpty) {
scribe.debug(
s"AskForWork ${sender()} $availableResource ${state.negotiation} ${state.queuedTasks.map { case (_, (sch, _)) =>
(sch.description.taskId, sch.resource)
}.toSeq}"
(sch.description.taskId, sch.resource)
}.toSeq}"
)

val launcher = LauncherActor(sender())
Expand All @@ -241,7 +241,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 +257,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 +274,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 ae7fba5

Please sign in to comment.