[ 
https://issues.apache.org/jira/browse/HIVE-22944?focusedWorklogId=539245&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-539245
 ]

ASF GitHub Bot logged work on HIVE-22944:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Jan/21 18:22
            Start Date: 21/Jan/21 18:22
    Worklog Time Spent: 10m 
      Work Description: abstractdog commented on a change in pull request #1798:
URL: https://github.com/apache/hive/pull/1798#discussion_r562101436



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/SerializationUtilities.java
##########
@@ -224,51 +224,57 @@ public Registration readClass(Input input) {
 
   private static final Object FAKE_REFERENCE = new Object();
 
-  private static KryoFactory factory = new KryoFactory() {
-    @Override
-    public Kryo create() {
-      KryoWithHooks kryo = new KryoWithHooks();
-      kryo.register(java.sql.Date.class, new SqlDateSerializer());
-      kryo.register(java.sql.Timestamp.class, new TimestampSerializer());
-      kryo.register(TimestampTZ.class, new TimestampTZSerializer());
-      kryo.register(Path.class, new PathSerializer());
-      kryo.register(Arrays.asList("").getClass(), new 
ArraysAsListSerializer());
-      kryo.register(new java.util.ArrayList().subList(0,0).getClass(), new 
ArrayListSubListSerializer());
-      kryo.register(CopyOnFirstWriteProperties.class, new 
CopyOnFirstWritePropertiesSerializer());
-      kryo.register(PartitionDesc.class, new PartitionDescSerializer(kryo, 
PartitionDesc.class));
-
-      ((Kryo.DefaultInstantiatorStrategy) kryo.getInstantiatorStrategy())
-          .setFallbackInstantiatorStrategy(
-              new StdInstantiatorStrategy());
-      removeField(kryo, AbstractOperatorDesc.class, "colExprMap");
-      removeField(kryo, AbstractOperatorDesc.class, "statistics");
-      kryo.register(ReduceWork.class);
-      kryo.register(TableDesc.class);
-      kryo.register(UnionOperator.class);
-      kryo.register(FileSinkOperator.class);
-      kryo.register(VectorFileSinkOperator.class);
-      kryo.register(HiveIgnoreKeyTextOutputFormat.class);
-      kryo.register(StandardConstantListObjectInspector.class);
-      kryo.register(StandardConstantMapObjectInspector.class);
-      kryo.register(StandardConstantStructObjectInspector.class);
-      kryo.register(SequenceFileInputFormat.class);
-      kryo.register(RCFileInputFormat.class);
-      kryo.register(HiveSequenceFileOutputFormat.class);
-      kryo.register(LlapOutputFormat.class);
-      kryo.register(SparkEdgeProperty.class);
-      kryo.register(SparkWork.class);
-      kryo.register(Pair.class);
-      kryo.register(MemoryMonitorInfo.class);
-
-      // This must be called after all the explicit register calls.
-      return kryo.processHooks(kryoTypeHooks, globalHook);
-    }
-  };
-
   // Bounded queue could be specified here but that will lead to blocking.
   // ConcurrentLinkedQueue is unbounded and will release soft referenced kryo 
instances under
   // memory pressure.
-  private static KryoPool kryoPool = new 
KryoPool.Builder(factory).softReferences().build();
+  private static Pool<Kryo> kryoPool = new Pool<Kryo>(true, false, 8) {
+    protected Kryo create() {
+      return createNewKryo();
+    }
+  };
+
+  public static Kryo createNewKryo() {
+    KryoWithHooks kryo = new KryoWithHooks();
+
+    kryo.setReferences(true);
+    kryo.setCopyReferences(true);
+    kryo.setRegistrationRequired(false);

Review comment:
       to be honest, because it works this way :) worst case I'll comment about 
what issues can come without these options set




----------------------------------------------------------------
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.

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 539245)
    Time Spent: 1h 10m  (was: 1h)

> Upgrade to Kryo5
> ----------------
>
>                 Key: HIVE-22944
>                 URL: https://issues.apache.org/jira/browse/HIVE-22944
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: László Bodor
>            Assignee: László Bodor
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-22944.01.patch, kryo4_vs_5_benchmark.log
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Maybe we should consider upgrading to kryo5 (plan ser/deser). Not sure about 
> performance benefits, but looking at the code, e.g. FieldSerializer in Kryo5 
> seems to let us extend it easier (less private fields), which could be a 
> benefit if we want to change its behavior, e.g. defining different logic for 
> different fields of an object.
> Kryo 4 FieldSerializer: 
> https://github.com/EsotericSoftware/kryo/blob/kryo-4/src/com/esotericsoftware/kryo/serializers/FieldSerializer.java
> Kryo 5 FieldSerialier: 
> https://github.com/EsotericSoftware/kryo/blob/master/src/com/esotericsoftware/kryo/serializers/FieldSerializer.java
> UPDATE: currently we are at kryo 5.0.3
> TODO: why kryo-shaded artifact has been used so far?
> https://javalibs.com/artifact/com.esotericsoftware/kryo-shaded
> "This contains the shaded reflectasm jar to prevent conflicts with other 
> versions of asm."



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to