@Override public T copy(T from) { checkKryoInitialized(); return KryoUtils.copy(from, kryo, this); }
private void checkKryoInitialized() { if (this.kryo == null) { this.kryo = new Kryo(); Kryo.DefaultInstantiatorStrategy instantiatorStrategy = new Kryo.DefaultInstantiatorStrategy(); instantiatorStrategy.setFallbackInstantiatorStrategy(new StdInstantiatorStrategy()); kryo.setInstantiatorStrategy(instantiatorStrategy); this.kryo.setAsmEnabled(true); KryoUtils.applyRegistrations(this.kryo, kryoRegistrations.values()); } }
@Override public T copy(T from, T reuse) { checkKryoInitialized(); return KryoUtils.copy(from, reuse, kryo, this); }
private void checkKryoInitialized() { if (this.kryo == null) { this.kryo = getKryoInstance(); // Enable reference tracking. kryo.setReferences(true); // Throwable and all subclasses should be serialized via java serialization // Note: the registered JavaSerializer is Flink's own implementation, and not Kryo's. // This is due to a know issue with Kryo's JavaSerializer. See FLINK-6025 for details. kryo.addDefaultSerializer(Throwable.class, new JavaSerializer()); // Add default serializers first, so that the type registrations without a serializer // are registered with a default serializer for (Map.Entry<Class<?>, ExecutionConfig.SerializableSerializer<?>> entry: defaultSerializers.entrySet()) { kryo.addDefaultSerializer(entry.getKey(), entry.getValue().getSerializer()); } for (Map.Entry<Class<?>, Class<? extends Serializer<?>>> entry: defaultSerializerClasses.entrySet()) { kryo.addDefaultSerializer(entry.getKey(), entry.getValue()); } KryoUtils.applyRegistrations(this.kryo, kryoRegistrations.values()); kryo.setRegistrationRequired(false); kryo.setClassLoader(Thread.currentThread().getContextClassLoader()); } }
@Override public T copy(T from) { checkKryoInitialized(); return KryoUtils.copy(from, kryo, this); }
private void checkKryoInitialized() { if (this.kryo == null) { this.kryo = new Kryo(); Kryo.DefaultInstantiatorStrategy instantiatorStrategy = new Kryo.DefaultInstantiatorStrategy(); instantiatorStrategy.setFallbackInstantiatorStrategy(new StdInstantiatorStrategy()); kryo.setInstantiatorStrategy(instantiatorStrategy); this.kryo.setAsmEnabled(true); KryoUtils.applyRegistrations(this.kryo, kryoRegistrations.values()); } }
@Override public T copy(T from, T reuse) { checkKryoInitialized(); return KryoUtils.copy(from, reuse, kryo, this); }
private void checkKryoInitialized() { if (this.kryo == null) { this.kryo = new Kryo(); Kryo.DefaultInstantiatorStrategy instantiatorStrategy = new Kryo.DefaultInstantiatorStrategy(); instantiatorStrategy.setFallbackInstantiatorStrategy(new StdInstantiatorStrategy()); kryo.setInstantiatorStrategy(instantiatorStrategy); this.kryo.setAsmEnabled(true); KryoUtils.applyRegistrations(this.kryo, kryoRegistrations.values()); } }
@Override public void setReference(T toCompare) { checkKryoInitialized(); reference = KryoUtils.copy(toCompare, kryo, new WritableSerializer<T>(type)); }
private void checkKryoInitialized() { if (this.kryo == null) { this.kryo = new Kryo(); Kryo.DefaultInstantiatorStrategy instantiatorStrategy = new Kryo.DefaultInstantiatorStrategy(); instantiatorStrategy.setFallbackInstantiatorStrategy(new StdInstantiatorStrategy()); kryo.setInstantiatorStrategy(instantiatorStrategy); kryo.setAsmEnabled(true); KryoUtils.applyRegistrations(kryo, kryoRegistrations.values()); } }
@Override public void setReference(T toCompare) { checkKryoInitialized(); reference = KryoUtils.copy(toCompare, kryo, new ValueSerializer<T>(type)); }
private void checkKryoInitialized() { if (this.kryo == null) { this.kryo = getKryoInstance(); // Enable reference tracking. kryo.setReferences(true); // Throwable and all subclasses should be serialized via java serialization // Note: the registered JavaSerializer is Flink's own implementation, and not Kryo's. // This is due to a know issue with Kryo's JavaSerializer. See FLINK-6025 for details. kryo.addDefaultSerializer(Throwable.class, new JavaSerializer()); // Add default serializers first, so that the type registrations without a serializer // are registered with a default serializer for (Map.Entry<Class<?>, ExecutionConfig.SerializableSerializer<?>> entry: defaultSerializers.entrySet()) { kryo.addDefaultSerializer(entry.getKey(), entry.getValue().getSerializer()); } for (Map.Entry<Class<?>, Class<? extends Serializer<?>>> entry: defaultSerializerClasses.entrySet()) { kryo.addDefaultSerializer(entry.getKey(), entry.getValue()); } KryoUtils.applyRegistrations(this.kryo, kryoRegistrations.values()); kryo.setRegistrationRequired(false); kryo.setClassLoader(Thread.currentThread().getContextClassLoader()); } }
@Override public T copy(T from) { checkKryoInitialized(); return KryoUtils.copy(from, kryo, this); }
private void checkKryoInitialized() { if (this.kryo == null) { this.kryo = getKryoInstance(); // Enable reference tracking. kryo.setReferences(true); // Throwable and all subclasses should be serialized via java serialization // Note: the registered JavaSerializer is Flink's own implementation, and not Kryo's. // This is due to a know issue with Kryo's JavaSerializer. See FLINK-6025 for details. kryo.addDefaultSerializer(Throwable.class, new JavaSerializer()); // Add default serializers first, so that the type registrations without a serializer // are registered with a default serializer for (Map.Entry<Class<?>, ExecutionConfig.SerializableSerializer<?>> entry: defaultSerializers.entrySet()) { kryo.addDefaultSerializer(entry.getKey(), entry.getValue().getSerializer()); } for (Map.Entry<Class<?>, Class<? extends Serializer<?>>> entry: defaultSerializerClasses.entrySet()) { kryo.addDefaultSerializer(entry.getKey(), entry.getValue()); } KryoUtils.applyRegistrations(this.kryo, kryoRegistrations.values()); kryo.setRegistrationRequired(false); kryo.setClassLoader(Thread.currentThread().getContextClassLoader()); } }
@Override public T copy(T from) { checkKryoInitialized(); return KryoUtils.copy(from, kryo, this); }
@Override public T copy(T from, T reuse) { checkKryoInitialized(); return KryoUtils.copy(from, reuse, kryo, this); }
@Override public T copy(T from, T reuse) { checkKryoInitialized(); return KryoUtils.copy(from, reuse, kryo, this); }
@Override public T copy(T from, T reuse) { checkKryoInitialized(); return KryoUtils.copy(from, reuse, kryo, this); }
@Override public T copy(T from) { checkKryoInitialized(); return KryoUtils.copy(from, kryo, this); }
@Override public T copy(T from) { checkKryoInitialized(); return KryoUtils.copy(from, kryo, this); }