-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fetch status of all scenarios in DM in a single operation instead of …
…separately for each scenario. (#7295)
- Loading branch information
Showing
25 changed files
with
682 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...ger-api/src/main/scala/pl/touk/nussknacker/engine/util/WithDataFreshnessStatusUtils.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package pl.touk.nussknacker.engine.util | ||
|
||
import pl.touk.nussknacker.engine.api.deployment.WithDataFreshnessStatus | ||
|
||
object WithDataFreshnessStatusUtils { | ||
|
||
implicit class WithDataFreshnessStatusMapOps[K, V](withDataFreshnessStatus: WithDataFreshnessStatus[Map[K, V]]) { | ||
|
||
def get(k: K): Option[WithDataFreshnessStatus[V]] = withDataFreshnessStatus.map(_.get(k)) match { | ||
case WithDataFreshnessStatus(Some(value), cached) => Some(WithDataFreshnessStatus(value, cached)) | ||
case WithDataFreshnessStatus(None, _) => None | ||
} | ||
|
||
def getOrElse(k: K, orElse: V): WithDataFreshnessStatus[V] = { | ||
withDataFreshnessStatus.map(_.get(k)) match { | ||
case WithDataFreshnessStatus(Some(value), cached) => WithDataFreshnessStatus(value, cached) | ||
case WithDataFreshnessStatus(None, cached) => WithDataFreshnessStatus(orElse, cached) | ||
} | ||
} | ||
|
||
} | ||
|
||
implicit class WithDataFreshnessStatusOps[A, B](scenarioActivity: WithDataFreshnessStatus[A]) { | ||
|
||
def withValue(v: B): WithDataFreshnessStatus[B] = { | ||
scenarioActivity.map(_ => v) | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.