Skip to content

Commit

Permalink
Add PipelineMetaDataProcessConfigurationGovernanceRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Nov 22, 2023
1 parent b4c47c0 commit 2b4a42c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ public final class PipelineMetaDataProcessConfigurationGovernanceRepository {
private final ClusterPersistRepository repository;

/**
* Get meta data process configuration.
* Persist meta data process configuration.
*
* @param jobType job type, nullable
* @return process configuration YAML text
* @param processConfigYamlText process configuration YAML text
*/
public String getMetaDataProcessConfiguration(final String jobType) {
return repository.getDirectly(PipelineMetaDataNode.getMetaDataProcessConfigPath(jobType));
public void persist(final String jobType, final String processConfigYamlText) {
repository.persist(PipelineMetaDataNode.getMetaDataProcessConfigPath(jobType), processConfigYamlText);
}

/**
* Persist meta data process configuration.
* Load meta data process configuration.
*
* @param jobType job type, nullable
* @param processConfigYamlText process configuration YAML text
* @return process configuration YAML text
*/
public void persistMetaDataProcessConfiguration(final String jobType, final String processConfigYamlText) {
repository.persist(PipelineMetaDataNode.getMetaDataProcessConfigPath(jobType), processConfigYamlText);
public String load(final String jobType) {
return repository.getDirectly(PipelineMetaDataNode.getMetaDataProcessConfigPath(jobType));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final class PipelineProcessConfigurationPersistService implements Pipelin

@Override
public PipelineProcessConfiguration load(final PipelineContextKey contextKey, final String jobType) {
String yamlText = PipelineAPIFactory.getGovernanceRepositoryAPI(contextKey).getMetaDataProcessConfigurationGovernanceRepository().getMetaDataProcessConfiguration(jobType);
String yamlText = PipelineAPIFactory.getGovernanceRepositoryAPI(contextKey).getMetaDataProcessConfigurationGovernanceRepository().load(jobType);
if (Strings.isNullOrEmpty(yamlText)) {
return null;
}
Expand All @@ -45,6 +45,6 @@ public PipelineProcessConfiguration load(final PipelineContextKey contextKey, fi
@Override
public void persist(final PipelineContextKey contextKey, final String jobType, final PipelineProcessConfiguration processConfig) {
String yamlText = YamlEngine.marshal(swapper.swapToYamlConfiguration(processConfig));
PipelineAPIFactory.getGovernanceRepositoryAPI(contextKey).getMetaDataProcessConfigurationGovernanceRepository().persistMetaDataProcessConfiguration(jobType, yamlText);
PipelineAPIFactory.getGovernanceRepositoryAPI(contextKey).getMetaDataProcessConfigurationGovernanceRepository().persist(jobType, yamlText);
}
}

0 comments on commit 2b4a42c

Please sign in to comment.