hmangla98 commented on a change in pull request #2724:
URL: https://github.com/apache/hive/pull/2724#discussion_r741586076
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/metric/MetricSink.java
##########
@@ -116,14 +117,17 @@ public void run() {
int totalMetricsSize = metrics.size();
List<ReplicationMetrics> replicationMetricsList = new
ArrayList<>(totalMetricsSize);
ObjectMapper mapper = new ObjectMapper();
+ MessageEncoder encoder =
MessageFactory.getDefaultInstanceForReplMetrics(conf);
+ MessageSerializer serializer = encoder.getSerializer();
for (int index = 0; index < totalMetricsSize; index++) {
ReplicationMetric metric = metrics.removeFirst();
ReplicationMetrics persistentMetric = new ReplicationMetrics();
persistentMetric.setDumpExecutionId(metric.getDumpExecutionId());
persistentMetric.setScheduledExecutionId(metric.getScheduledExecutionId());
persistentMetric.setPolicy(metric.getPolicy());
-
persistentMetric.setProgress(mapper.writeValueAsString(metric.getProgress()));
-
persistentMetric.setMetadata(mapper.writeValueAsString(metric.getMetadata()));
+
persistentMetric.setProgress(serializer.serialize(mapper.writeValueAsString(metric.getProgress())));
+
persistentMetric.setMetadata(serializer.serialize(mapper.writeValueAsString(metric.getMetadata())));
Review comment:
Tested with one such sample metadata entry.
Plain text was of 234 bytes and using compression, output string was of 209
Bytes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]