public TopologyActionsService(StreamCatalogService catalogService, EnvironmentService environmentService,
FileStorage fileStorage, MLModelRegistryClient modelRegistryClient,
Map<String, Object> configuration, Subject subject, TransactionManager transactionManager) {
this.catalogService = catalogService;
this.environmentService = environmentService;
this.fileStorage = fileStorage;
this.topologyDagBuilder = new TopologyDagBuilder(catalogService, modelRegistryClient);
this.configFileWriter = new ConfigFileWriter();
Map<String, String> conf = new HashMap<>();
for (Map.Entry<String, Object> confEntry : configuration.entrySet()) {
Object value = confEntry.getValue();
conf.put(confEntry.getKey(), value == null ? null : value.toString());
}
String topologyTestRunResultDir = conf.get(TOPOLOGY_TEST_RUN_RESULT_DIR);
if (StringUtils.isEmpty(topologyTestRunResultDir)) {
throw new RuntimeException("Configuration of topology test run result dir is not set.");
}
if (topologyTestRunResultDir.endsWith(File.separator)) {
topologyTestRunResultDir = topologyTestRunResultDir.substring(0, topologyTestRunResultDir.length() - 1);
}
this.topologyActionsContainer = new TopologyActionsContainer(environmentService, conf, subject);
this.stateFactory = TopologyStateFactory.getInstance();
this.topologyTestRunner = new TopologyTestRunner(catalogService, this, topologyTestRunResultDir);
this.managedTransaction = new ManagedTransaction(transactionManager, TransactionIsolation.DEFAULT);
}