aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/training-core/hdfs-writer-source-code/hdfs-writer/src/main/java/Orchestrator.java
diff options
context:
space:
mode:
authorDileep Ranganathan <dileep.ranganathan@intel.com>2019-05-30 12:38:37 -0700
committerDileep Ranganathan <dileep.ranganathan@intel.com>2019-05-30 21:11:52 +0000
commit3d5a3e06530c1250d48f7d838c619f3bfbcd019d (patch)
tree349e370c43ce7318b3f7eb7736345de6872cbef2 /vnfs/DAaaS/training-core/hdfs-writer-source-code/hdfs-writer/src/main/java/Orchestrator.java
parent31802660dfe74a8671ae29789f0018f0f887ea1a (diff)
Refactor Distributed Analytics project structure
Modified the project structure to improve maintainability and to add future CI and integration test support. Change-Id: Id30bfb1f83f23785a6b5f99e81f42f752d59c0f8 Issue-ID: ONAPARC-280 Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
Diffstat (limited to 'vnfs/DAaaS/training-core/hdfs-writer-source-code/hdfs-writer/src/main/java/Orchestrator.java')
-rw-r--r--vnfs/DAaaS/training-core/hdfs-writer-source-code/hdfs-writer/src/main/java/Orchestrator.java51
1 files changed, 0 insertions, 51 deletions
diff --git a/vnfs/DAaaS/training-core/hdfs-writer-source-code/hdfs-writer/src/main/java/Orchestrator.java b/vnfs/DAaaS/training-core/hdfs-writer-source-code/hdfs-writer/src/main/java/Orchestrator.java
deleted file mode 100644
index b4daf2d1..00000000
--- a/vnfs/DAaaS/training-core/hdfs-writer-source-code/hdfs-writer/src/main/java/Orchestrator.java
+++ /dev/null
@@ -1,51 +0,0 @@
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-import config.Configuration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class Orchestrator {
-
- private static Logger logger = LoggerFactory.getLogger(Orchestrator.class);
-
- public void init(String configYamlFile){
-
- parseConfigYaml(configYamlFile);
- }
-
- private void parseConfigYaml(String configYaml) {
-
- URL fileUrl = getClass().getResource(configYaml);
- if(fileUrl==null)
- System.out.println("::: Config file missing!!! :::");
-
- else{
- Configuration conf = new Configuration();
- ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
- String realConfigYaml = configYaml;
-
- if (!realConfigYaml.startsWith("/")) {
- realConfigYaml = "/" + configYaml;
- }
- Map<String, Object> configs;
- try (InputStream is = getClass().getResourceAsStream(realConfigYaml)) {
- TypeReference<HashMap<String, Object>> typeRef
- = new TypeReference<HashMap<String, Object>>() {
- };
- configs = mapper.readValue(is, typeRef);
- conf.init(configs);
-
- } catch (Exception e) {
- logger.error(e.getMessage());
- }
- }
- }
-}
-