Search in sources :

Example 1 with FireCloudClass

use of com.epam.pipeline.entity.metadata.FireCloudClass in project cloud-pipeline by epam.

the class MetadataEntityConverter method convert.

public static Map<String, String> convert(List<MetadataEntity> entities) {
    Map<FireCloudClass, FireCloudData> content = new EnumMap<>(FireCloudClass.class);
    entities.forEach(entity -> {
        FireCloudClass fireCloudClass = entity.getClassEntity().getFireCloudClassName();
        Assert.notNull(fireCloudClass, "Fire Cloud class must be specified.");
        FireCloudData dataContent = content.computeIfAbsent(fireCloudClass, key -> new FireCloudData(fireCloudClass, entity.getData()));
        dataContent.put(entity);
    });
    Map<String, String> result = new HashMap<>();
    content.forEach(((fireCloudClass, fireCloudData) -> {
        result.put(fireCloudClass.getFileName(), fireCloudData.getContent());
        if (fireCloudData.isSet()) {
            result.put(fireCloudClass.getMembershipFileName(), fireCloudData.getMembershipContent());
        }
    }));
    return result;
}
Also used : List(java.util.List) MetadataEntity(com.epam.pipeline.entity.metadata.MetadataEntity) FireCloudClass(com.epam.pipeline.entity.metadata.FireCloudClass) EnumMap(java.util.EnumMap) Map(java.util.Map) HashMap(java.util.HashMap) Assert(org.springframework.util.Assert) HashMap(java.util.HashMap) FireCloudClass(com.epam.pipeline.entity.metadata.FireCloudClass) EnumMap(java.util.EnumMap)

Example 2 with FireCloudClass

use of com.epam.pipeline.entity.metadata.FireCloudClass in project cloud-pipeline by epam.

the class FirecloudRunner method runFirecloudAnalysis.

private PipelineRun runFirecloudAnalysis(FirecloudConfiguration settings, FirecloudRunConfigurationEntry entry, Long configurationId, List<Long> entities, Long projectId) {
    FireCloudClass rootEntityType = metadataEntityManager.loadClass(entry.getRootEntityId()).getFireCloudClassName();
    PipelineStart startVO = createFirecloudStart(settings, entry, entities, projectId, configurationId, rootEntityType);
    PipelineConfiguration runConfiguration = pipelineConfigurationManager.getPipelineConfiguration(startVO);
    runConfiguration.setExecutionPreferences(FirecloudPreferences.builder().method(entry.getMethodName()).methodSnapshot(entry.getMethodSnapshot()).methodConfiguration(entry.getMethodConfigurationName()).methodConfigurationSnapshot(entry.getMethodSnapshot()).build());
    addCredentials(runConfiguration, settings);
    return pipelineRunManager.launchPipeline(runConfiguration, null, null, startVO.getInstanceType(), startVO.getParentNodeId(), startVO.getConfigurationName(), null, null, entities, configurationId, startVO.getRunSids());
}
Also used : FireCloudClass(com.epam.pipeline.entity.metadata.FireCloudClass) PipelineConfiguration(com.epam.pipeline.entity.configuration.PipelineConfiguration) PipelineStart(com.epam.pipeline.entity.pipeline.run.PipelineStart)

Aggregations

FireCloudClass (com.epam.pipeline.entity.metadata.FireCloudClass)2 PipelineConfiguration (com.epam.pipeline.entity.configuration.PipelineConfiguration)1 MetadataEntity (com.epam.pipeline.entity.metadata.MetadataEntity)1 PipelineStart (com.epam.pipeline.entity.pipeline.run.PipelineStart)1 EnumMap (java.util.EnumMap)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Assert (org.springframework.util.Assert)1