summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislav Marszalek <s.marszalek2@partner.samsung.com>2021-09-14 13:43:52 +0200
committerStanislav Marszalek <s.marszalek2@partner.samsung.com>2021-09-14 13:43:52 +0200
commitbada18be8dcc91fca5e31f9c0eea60f86f6e7b61 (patch)
tree94464c1ab98cf642d0a0a4f64d9ac5c07c7a4229
parentb3c16df30a7e63a9ad7d48b818cc55bec5f576b4 (diff)
O1 PM Bulk support in DataCollector RAPP - fix Traffic model values
Issue-ID: INT-1947 Signed-off-by: Stanislav Marszalek <s.marszalek2@partner.samsung.com> Change-Id: I02d3684c98d563d7f386de2fdf032e280ac74b3f
-rw-r--r--datacollector/src/main/java/org/onap/rapp/datacollector/service/FileReadyParserImpl.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/datacollector/src/main/java/org/onap/rapp/datacollector/service/FileReadyParserImpl.java b/datacollector/src/main/java/org/onap/rapp/datacollector/service/FileReadyParserImpl.java
index 831b026..4be3377 100644
--- a/datacollector/src/main/java/org/onap/rapp/datacollector/service/FileReadyParserImpl.java
+++ b/datacollector/src/main/java/org/onap/rapp/datacollector/service/FileReadyParserImpl.java
@@ -18,13 +18,6 @@ import static java.util.Objects.nonNull;
import static org.onap.rapp.datacollector.service.PMService.CELL_FIELD_NAME;
import static org.onap.rapp.datacollector.service.PMService.VALUE_NAME;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParseException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collections;
@@ -33,6 +26,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import org.onap.rapp.datacollector.entity.fileready.FileReadyEvent;
import org.onap.rapp.datacollector.entity.fileready.MeasDataCollection;
import org.onap.rapp.datacollector.entity.fileready.MeasDataCollection.MeasInfo;
@@ -45,6 +39,14 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
+
@Service
public class FileReadyParserImpl extends ParserAbstractClass implements VesParser {
@@ -119,8 +121,8 @@ public class FileReadyParserImpl extends ParserAbstractClass implements VesParse
}
private Map<String, String> createAdditionalMeasurementHashMap(String value) {
- if (!value.contains(MAP_ENTITY_DELIMITER)) {
- return Collections.singletonMap(VALUE_NAME, value);
+ if (!value.contains(MAP_VALUES_DELIMITER)) {
+ return Stream.of(value.split(MAP_ENTITY_DELIMITER)).collect(Collectors.toMap(v-> VALUE_NAME,v-> v));
} else {
return Stream.of(value.split(MAP_ENTITY_DELIMITER))
.map(m -> m.split(MAP_VALUES_DELIMITER))