You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/10/20 07:15:43 UTC

[GitHub] [hive] hmangla98 commented on a change in pull request #2724: HIVE-25596: Compress Hive Replication Metrics while storing

hmangla98 commented on a change in pull request #2724:
URL: https://github.com/apache/hive/pull/2724#discussion_r732477821



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/repl/metric/MetricSink.java
##########
@@ -116,14 +118,15 @@ public void run() {
           int totalMetricsSize = metrics.size();
           List<ReplicationMetrics> replicationMetricsList = new ArrayList<>(totalMetricsSize);
           ObjectMapper mapper = new ObjectMapper();
+          MessageSerializer serializer = GzipJSONMessageEncoder.getInstance().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:
       I tried with a string of 100 characters(100 Bytes) and the compressed string was of 24 Bytes which is reduced by 76% of original string.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
##########
@@ -510,6 +510,7 @@
     system.registerGenericUDF("sort_array", GenericUDFSortArray.class);
     system.registerGenericUDF("sort_array_by", GenericUDFSortArrayByField.class);
     system.registerGenericUDF("array_contains", GenericUDFArrayContains.class);
+    system.registerGenericUDF("deserialize", GenericUDFDeserialize.class);

Review comment:
       Done




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org