Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
systemsmanagement:Ardana:8:CentOS:7.5
openstack-monasca-persister-java
0001-Bugfix-Parse-value_meta-information.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Bugfix-Parse-value_meta-information.patch of Package openstack-monasca-persister-java
From 23d046761425897772e866ceb1e40c5c91e5b464 Mon Sep 17 00:00:00 2001 From: Kamil Choroba <kamil.choroba@est.fujitsu.com> Date: Mon, 8 May 2017 14:58:26 +0200 Subject: [PATCH] Bugfix: Parse value_meta information This fix refactores the value_meta information that the influxdb is able to work with. Change-Id: I4e5c8e860fcaf9f3b707877a01d041b64afa8f92 --- .../monasca/persister/repository/influxdb/InfluxV9MetricRepo.java | 2 +- .../java/monasca/persister/repository/influxdb/Measurement.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/java/src/main/java/monasca/persister/repository/influxdb/InfluxV9MetricRepo.java b/java/src/main/java/monasca/persister/repository/influxdb/InfluxV9MetricRepo.java index 74e058f..b4ba9d0 100644 --- a/java/src/main/java/monasca/persister/repository/influxdb/InfluxV9MetricRepo.java +++ b/java/src/main/java/monasca/persister/repository/influxdb/InfluxV9MetricRepo.java @@ -103,7 +103,7 @@ public class InfluxV9MetricRepo extends InfluxMetricRepo { } else { valueMap.put("value_meta", - new StringBuilder().append('"').append(valueMetaJSONString).append('"').toString()); + new StringBuilder().append("\"").append(valueMetaJSONString).append("\"")); } diff --git a/java/src/main/java/monasca/persister/repository/influxdb/Measurement.java b/java/src/main/java/monasca/persister/repository/influxdb/Measurement.java index db8c65b..5b03b41 100644 --- a/java/src/main/java/monasca/persister/repository/influxdb/Measurement.java +++ b/java/src/main/java/monasca/persister/repository/influxdb/Measurement.java @@ -17,6 +17,7 @@ package monasca.persister.repository.influxdb; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.lang3.StringEscapeUtils; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.format.DateTimeFormatter; @@ -76,12 +77,13 @@ public final class Measurement { if (!this.valueMeta.isEmpty()) { try { - - return objectMapper.writeValueAsString(this.valueMeta); + return StringEscapeUtils.escapeJson( + objectMapper.writeValueAsString(this.valueMeta)); } catch (JsonProcessingException e) { - logger.error("Failed to serialize value meta {}", this.valueMeta, e); + logger.error("Failed to serialize value meta {}", + this.valueMeta, e); } -- 2.12.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor