-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
State verification mechanism reusing mini cluster + configuration + r…
…efactors
- Loading branch information
Showing
25 changed files
with
582 additions
and
468 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
94 changes: 0 additions & 94 deletions
94
...ink/executor/src/main/scala/pl/touk/nussknacker/engine/process/runner/FlinkTestMain.scala
This file was deleted.
Oops, something went wrong.
72 changes: 0 additions & 72 deletions
72
...utor/src/main/scala/pl/touk/nussknacker/engine/process/runner/FlinkVerificationMain.scala
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
.../pl/touk/nussknacker/engine/process/scenariotesting/AdHocMiniClusterFallbackHandler.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,36 @@ | ||
package pl.touk.nussknacker.engine.process.scenariotesting | ||
|
||
import org.apache.flink.configuration.Configuration | ||
import pl.touk.nussknacker.engine.api.StreamMetaData | ||
import pl.touk.nussknacker.engine.canonicalgraph.CanonicalProcess | ||
import pl.touk.nussknacker.engine.util.MetaDataExtractor | ||
|
||
// This class handles a legacy ad-hoc way to create minicluster. | ||
// After we fully switch to single mini cluster approach, it should be removed | ||
object AdHocMiniClusterFallbackHandler { | ||
|
||
def handleAdHocMniClusterFallback[R]( | ||
reusableMiniClusterWrapperOpt: Option[ScenarioTestingMiniClusterWrapper], | ||
scenario: CanonicalProcess | ||
)(f: ScenarioTestingMiniClusterWrapper => R): R = { | ||
val miniClusterWrapper = reusableMiniClusterWrapperOpt.getOrElse { | ||
createAdHocMiniClusterWrapper(scenario) | ||
} | ||
try { | ||
f(miniClusterWrapper) | ||
} finally { | ||
if (reusableMiniClusterWrapperOpt.isEmpty) { | ||
miniClusterWrapper.close() | ||
} | ||
} | ||
} | ||
|
||
private def createAdHocMiniClusterWrapper(process: CanonicalProcess) = { | ||
val scenarioParallelism = MetaDataExtractor | ||
.extractTypeSpecificDataOrDefault[StreamMetaData](process.metaData, StreamMetaData()) | ||
.parallelism | ||
.getOrElse(1) | ||
ScenarioTestingMiniClusterWrapper.create(scenarioParallelism, new Configuration()) | ||
} | ||
|
||
} |
Oops, something went wrong.