pgaref commented on a change in pull request #1798:
URL: https://github.com/apache/hive/pull/1798#discussion_r562130303



##########
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:
       Sure, makes sense! 




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to